The Sprockets asset pipeline processes and optimizes static assets like CSS and JavaScript by compiling, concatenating, and minifying them. This helps the browser load pages faster.
Files required in the application.js manifest are concatenated and compiled into one bundle for efficient delivery in production.
// application.js manifest file
The directive //= require_tree . tells Sprockets to include all files in the current directory and its subdirectories.
If a CSS file is not referenced in application.css or listed in config.assets.precompile, it won't be compiled and served in production.
Sprockets appends a unique hash fingerprint to asset filenames during precompilation to help browsers cache assets effectively.
