why webpack is a good thing for rails apps and how it would improve things?
Wondering anyone has come across any good articles on why webpack is a good thing for rails apps and how it would improve things? I'm behind the eight ball with this and a google search brings up lots of stuff so hoping some here might be able to point me to some useful articles. Thanks
No any search results
You already invited:
1 Answers
peta
Upvotes from:
- Rails had, and still has, the asset pipeline, which solved the problem of how to use JS, Sass, etc in your Rails applications.
- Since then, JS development has changed a fair bit, and the popularity of single page applications (SPAs) has meant that peoples’ workflow in JS has changed
- The asset pipeline isn’t really set up to handle the newer workflows, while Webpack is
- The Rails team introduced Webpacker to solve this problem, and I believe they will eventually deprecate the asset pipeline
- Webpack does the job of bundling up your JS and serving it where it needs to be served, and allows you to run it through transformers, so you can use technologies like ES7 and TypeScript in your Rails applications
Webpacker in Rails helps us move from a ‘sprinkles here, sprinkles there’ approach to JavaScript to a more app-like approach to JavaScript, where you might be using different frameworks and libraries for your UIs rather than relying on erb