Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
What's the benefit of Webpacker? #1371
Feel free to close this ticket. I'm not sure where a good forum is for this question (I asked in #rubyonrails IRC but didn't get a satisfactory answer).
I'm trying to understand the benefit of Webpacker VS managing static assets with vanilla Webpack entirely outside of Rails.
Here's what I think are benefits of Webpacker:
And the downsides of Webpacker?:
When I try to understand a new technology, I find it helpful to learn when not to use it. Is my case when I should not use Webpacker? Are there benefits I'm overlooking? Are there downsides I'm overlooking? Is the answer to this ticket "go read the docs?"
Webpacker doesn't depend on Sprockets or use it, you can use Webpacker in an app without Sprockets
If you are not using Rails and Webpack for modern JS.
Webpacker out of the box comes with production ready webpack configs that you don't have to touch in most cases. I understand
Webpacker is an ideal choice because you don't have to do all this
But the most important benefit that we often overlook is our happiness and experience as programmers. If things are integrated and part of one workflow, then it leads to better and happy work. I guess that's what been the mantra of Rails stack - to provide integrated systems that work together. Obviously, things aren't 100% but we are working towards making Webpacker better and integrated, just like asset pipeline and you can contribute too
I have recently published this example: https://github.com/gauravtiwari/webpacker-api-frontend, which is basically Rails API and JS frontend. In production, you can use nginx or similar to serve static assets from
Obviously, it's your choice in the end ^_^