-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
fix(index): skip not changed chunk files in watch mode (fix #133) #134
Conversation
Codecov Report
@@ Coverage Diff @@
## master #134 +/- ##
===========================================
- Coverage 100.00% 97.75% -2.25%
===========================================
Files 2 2
Lines 74 89 +15
Branches 25 29 +4
===========================================
+ Hits 74 87 +13
- Misses 0 2 +2
Continue to review full report at Codecov.
|
I've fixed tests. |
Published it as |
I've refactored a bit to include files from modules as well and added test in watch + development modes. |
"async.js", | ||
396, | ||
], | ||
Array [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here you can see that only gz file for async module is regenerated, since it was changed
It is not good solution because our output is not deterministic and potential break other plugins, we have cache option, why don't use this? |
New gzip files with very the same content but different timestamp are emitted with the cache option and breaks express.js resource caching. Is there a way to preserve timestamps with the cache option? |
I don't think it changes anything without watch mode. For single compilation it works as before. Also it's implemented with the approach suggested by webpack docs https://webpack.js.org/contribute/plugin-patterns/#changed-chunks. |
Can you create reproducible test repo? |
@evilebottnawi there is a reference to repo on the issue: #133 (comment) It's configured for watching with cache enabled. |
Thanks, ping me tomorrow, i will look at this |
@evilebottnawi ping |
@evilebottnawi Hi guys! I got here because I was about to open an issue for the same reason @akosyakov did. I've not fully got through all the changes in this PR, but it seems a little over-complicated. Especially because Webpack already has its own cache/emission logic which could be re-used by simply changing current used hook. The solution: Currently, "compression-webpack-plugin" is taping into Finally, check-passing assets are effectively written and Initially I though that Additionally, this is already done asynchronously using "neo-async" library, so no additional looping would be needed, thus increasing performance. I think that solution should be clear from here and it should be way more simple than expected. I would be glad to try fixing this issue if you like. Please let me know. Note: Hope I'm not missing something. |
@ernestostifano if there will be official better solution i'm all in for using it :) So far we were using |
@akosyakov sorry for delay, WIP on the problem |
Sorry again for big delay, fixed in master |
@evilebottnawi thank you, that's fine :) |
This PR contains a:
Motivation / Use-Case
See #133 (comment)
Breaking Changes
Additional Info
I have not looked at tests yet, but would like to know whether it is right approach first? cc @evilebottnawi
I've followed this guidelines to check whether a chunk is changed: https://webpack.js.org/contribute/plugin-patterns/#changed-chunks