-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
vote: lazy compilation mode #150
Comments
Thanks for opening an issue. |
@shellscape for now, dev-server with lazy takes ~800mb, this plugin ~1100mb |
A few more questions so we can get on the same page for this request: Which webpack CLI are you using to run the webpack build with this plugin? (If not already using it) If you try What are the compiled bundle sizes? About how many files make up each bundle? |
@bebraw @playma256 are either of you aware of a means to cancel a compilation within a hook (or any other means)? The problem we've got with this request is that WDM runs it's own compiler and uses chokidar to watch the files for a compiler, rather than using webpack's internal watcher. It can start and stop compilations that way. That's not something we want to do here - the complication of juggling that would mean we adopt the same disadvantages as WDM. |
No @shellscape Accordingly to Tobias, adding an abort o watch mode is not easy to implement and they don’t have any ideas/solutions for that And also there is something that nuxt implements that sort of cancels the compilation... I was not able to locate which part of the code does that. |
For Nuxt I think it was just that multiple file changes were causing multiple compiles so they implemented a debounce of some kind. But I could be wrong about that. I was also looking to see if there was some way to delay one of the compilers in a multicompiler. https://github.com/MattDiMu/webpack-delay-plugin/blob/master/index.js We might be able to use this approach in conjunction with koa-router internally, like using a |
I've spent a bunch of time looking into how to best implement this. I managed to get a working example of how this would go, and it's not rocket science by any means. Here are the basic component parts:
It works, but it jacks up the flow of code quite a bit, and it's a fair bit of extra code we'd have to add. All that said, I'm not opposed to adding this, but we're going to have to get a pretty good response from the userbase to make all of that happen. I'm going to turn this into a voting feature issue and set the threshold at 120 👍 - or about 2% of the userbase. |
Please vote for this feature by using the Github Reactions button and the 👍 reaction. When this feature reaches 120 votes, it will be reconsidered.
Feature Use Case
Compile only on first request, needed when the client part is divided into separate modules (microfrontends?)
is it even possible?
Feature Proposal
The same as https://webpack.js.org/configuration/dev-server/#devserverlazy-
Reason
It takes up too much RAM
The text was updated successfully, but these errors were encountered: