-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Feature] Slow for webpack-dev-server when recompile #3311
Comments
Webpack treats each "virtual" as its own module, so a project with a lot of PNP virtuals will be slower than a node_modules project with no virtuals. I have a webpack feature request here: webpack/webpack#13813 |
@noahnu |
@larixer For my project, the bundle size are almost same, there is no big difference from pnp and nm. |
@fengerzh It means the problem inside webpack is related to non-optimal pnp tree traversal and not related to virtuals at all. |
Might also be related to webpack/webpack#12483 (comment)? |
I found there are lots of
Do I need to wrap these
|
Describe the user story
For
pnp
mode, everything works fine, but when running React project withyarn start
, awebpack-dev-server
running, if change even one line of code, it will begin to compile again, and it will take about 30 seconds to finish. If I switch tonode_modules
mode, it only take about 1 second.Describe the solution you'd like
I read issues with
yarn run
performance of #1817 and #973, both seems not similiar to my issue. In my situation,yarn run start
speed is acceptable, it will take about 30 seconds even withnode-modules
mode. The problem is forrecompiling
, even change one line of code, webpack-dev-server will begin to recompile, this will take about 1 second innode-modules
mode, but will take 30 seconds inpnp
mode, I hope to know why the difference is so big, what exactly causing the problem.Describe the drawbacks of your solution
Seems I have no solution yet.
Describe alternatives you've considered
Seems no alternatives, the only solution is not only optimize the
yarn run
performance, but also considerrecompiling
performance when webpack-dev-server running.The text was updated successfully, but these errors were encountered: