-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use webpack-dev-server not managed by webpacker/Rails? #2348
Comments
Did you follow this? Are you running webpacker/docs/webpack-dev-server.md Lines 4 to 14 in cc98e59
|
No. |
My ( |
Cool, thanks for that link. Just to be clear before closing this issue... If using standalone webpack, it's probably best to forgo webpacker altogether and write your own helper methods that use |
For the most part, the code around resolving & caching entrypoints is pretty useful even if you aren't within the bounds of webpacker. I'd personally like to see the general-use parts of webpacker exposed, enabling à la carte usage. |
I mentioned the same concept in great detail over there too: nikushi/minipack#12 (comment) |
Nice. I ended up biting the bullet and built my own lightweight rails <-> webpack integration so that I could run I probably would have stayed with Webpacker, but the reason I ended up migrating away was that there were too many layers of abstraction - there's already multiple layers of webpack config (production, development, test, common), and then webpacker adds its own webpacker.yml config on top of that. I appreciate that it's a very expressive configuration, but I needed really fine-grained control that I couldn't figure out how to get with webpacker. This makes debugging and profiling webpack hard as well. Webpacker is absolutely the right step for Rails - I still swear by this ecosystem because of how quickly it helps me get things done. If this gem didn't exist, I have probably moved awa, or started bifurcating my apps into two separate repos, backend and frontend, which has always felt a little heavy-handed to me. I'd love to see a world where webpacker does all of its config in javascript, and uses something like webpack-merge to make it DRY. That way, you get config but also are never too far from what's actually going on under the hood. Perhaps this is why a lot of frameworks use the That said, I'm going to keep a close eye and try and be more active with the webpacker gem. This is probably one of the most impactful projects out there and is the linchpin to the Rails community. Huge shout-out and hat-tip to @gauravtiwari, @dhh, @jakeNiemiec and everyone who's contributed. |
This comment has been minimized.
This comment has been minimized.
I ended up writing my own standalone webpack <-> Rails code too. It took all of 5 mins (that's not counting how long it took me to learn webpack in the first place, heh, phew). I simply wrote my own I would like to cache the contents of Anyway, thanks for the help and guidance! |
If you look at the PR for the eject feature, you can see every time it had been linked to from a conversation like we are having right now. That user went on to make webpacker_ejector. I really hope we can bring ejecting for advanced user to webpacker@5 |
Nice, I wasn't aware of that gem. Definitely would have used it + stuck with webpacker had I known it existed. +1 for ejecting in webpacker@5. |
@cjbottaro Would you be able to provide a link to your standalone webpack <-> Rails code? Would be helpful to look at how your implemented |
Hi. I have a webpack-dev-server that is running as part of a project that is completely separate from my Rails app, yet I want my Rails app to use that webpack-dev-server for all its assets.
Here's the output of the webpack-dev-server...
I thought setting my
webpacker.yml
to point to that webpack-dev-server would be enough:But it doesn't work.
How do I get webpacker to play nicely with a webpack-dev-server that is not managed by webpacker/Rails?
Thanks for the help.
The text was updated successfully, but these errors were encountered: