Webpacker vs Asset Pipeline
summary
Concrete comparison: Webpacker is a Rails wrapper around Webpack and actually builds a dependency graph so duplicate code is eliminated, while Sprockets concatenates via transformers/processors/compressors and can duplicate imports unless configured. Webpack uses loaders to turn .vue .sass and images into static files, outputs to public/packs with useful map files, and keeps source assets under app/javascripts/packs. At Nift the team keeps most JS in Rails partials and this mixed approach works for their mostly static app.
AI-written summary · about
chapters (9)
- 0:00Introduction to Webpacker
- 1:51The Rails asset pipeline
- 3:16Extending sprockets
- 5:26Introduction to Webpack
- 6:56Webpacker loaders
- 9:16Asset outputs and locations
- 11:00Creating components
- 12:33Bundling strategies
- 15:28Conclusion and Q&A
related talks
37mWebpacker, It-Just-Works, But How?
32mWebpacking for the Journey Ahead
34mFrom Sprockets to js-bundling: Evolution of JavaScript tooling in Rails!
28mWebpack for a better development workflow
29mRails Asset Pipeline: Defunct or Da Funk
30mHow Sprockets works
45mBundler Bonanza
29mAggregation with Sprockets
