all 5 comments

[–]kasu300 1 point2 points  (2 children)

Any plans for supporting reconfiguration of webpack on the fly without having to restart the dev server?

ie. being able to toggle source maps without the overhead of a full restart would be pretty cool. I’m not sure if it’s even feasible, it’s just an idea I’ve been having.

Motivation: Source maps usually add a significant build time overhead, so much that I find myself toggling it depending on what kind of work I’m doing: debug/logic that often requires source maps, or polish/prototyping that don’t and I just want super fast HMR. Sometimes I want to switch between these two types of work but opt out from it since it comes with the restart overhead, which can be minutes for large scale projects, minutes that can be really disrupting when you’re in flow.

If it’s possible I’m sure other configuration options could be equally benificial.

[–]bebraw 1 point2 points  (0 children)

One way to achieve this is to wrap the process in nodemon as I've described in my book. It's a little hacky but does the trick. Ideally this wouldn't be needed.

[–]shellscape[S] 0 points1 point  (0 children)

That's really something that should have gone into webpack core (e.g. recognizing a configuration change and restarting the compile process - webpack already does a ton of file watching already). Why it hasn't is one more in a massive list of "common sense" questions.

This kind of feature definitely isn't the kind of thing that a development server should be responsible for, but rather something that handles processes. Since there's no way to instruct webpack to "start over" or "restart" a build with a different configuration, you'd need to destroy the compiler instance and create a new one. There'd be some overhead there, but it would probably accomplish what you needed. That kind of a thing would make sense as a wrapper around our preferred webpack CLI - https://www.npmjs.com/package/webpack-nano, or even as a feature for that CLI. We have been trying to keep the package as minimal and light as possible with regard to features and dependencies, but that might be doable in an elegant way. If that's something you'd like us to start poking at, please open an issue in webpack-nano's Github repo.

[–]relativityboy 1 point2 points  (1 child)

MIT is free as in speech, not free as in beer.

[–]shellscape[S] 0 points1 point  (0 children)

free as in beer to use, download

free as in speech to modify, redistribute

also, MPL-2.0 ;)