Skip to content
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

Why not use rake to run webpack-dev-server? #831

Closed
curvo opened this issue Sep 19, 2017 · 2 comments
Closed

Why not use rake to run webpack-dev-server? #831

curvo opened this issue Sep 19, 2017 · 2 comments

Comments

@curvo
Copy link
Contributor

curvo commented Sep 19, 2017

I noticed over the weekend that my local version of ./bin/webpack-dev-server was not actually up to date with the current gem in my project [email protected]. I realized then that one would need to run rake webpacker:install in order to update the binstubs within my project and that lead me to wondering if it would be possible to run the dev server using rake.

I now have a fairly simple proof-of-concept working with a new rake task defined within my local version of the webpacker gem. I can now start the webpack-dev-server using rake which means I don't need an executable file checked into my repo for that.

Was this sort of approach considered at all in the past? And do you think it would be a possible direction to go?

It seems to me that minimizing the steps and dependencies for using webpacker will hopefully help to reduce issues over time and make adoption that much easier.

If this is an interesting idea at all I would love to clean things up and offer a PR replacing both the webpack-dev-server and webpack binstub files with rake tasks and removing the dependency of checking those files into all rails repos.

@gauravtiwari
Copy link
Member

@curvo Thanks for this.

Was this sort of approach considered at all in the past?

No actually, the idea was keep things simple and follow Rails conventions

And do you think it would be a possible direction to go?

Yeah sounds good, although not sure about using rake task for running things like dev server since that's a long running process instead of one off job. Might affect logging etc.

I have been thinking too on this but didn't get chance to make a PR. The best path would be to ship bins as GEM executables so this can be updated and loaded using bundle binstubs webpacker when needed but the actual binary would live inside the GEM so internal code changes won't affect the behaviour (much like Rails or Rake binstub)

@curvo
Copy link
Contributor Author

curvo commented Sep 20, 2017

@gauravtiwari @rossta - Thanks for the update and awesome turn-around!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants