-
-
Notifications
You must be signed in to change notification settings - Fork 384
feat(index): add [contenthash]
support
#30
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #30 +/- ##
====================================
Coverage 0% 0%
====================================
Files 3 3
Lines 157 167 +10
Branches 32 34 +2
====================================
- Misses 125 133 +8
- Partials 32 34 +2
Continue to review full report at Codecov.
|
Documentation should be updated as well! |
Let's get this merged @sokra :) |
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.
@chenxsan Thx
@michael-ciniawsky any time table when this gets merged finally? |
@vertic4l I don't have access here, that's up to Tobias atm :), From my side it's g2g, the only thing notable here is that the hash of the JS chunk will nevertheless change when the CSS changes... |
So it mitigates caching problems at best (the CSS will keep the hash) |
@michael-ciniawsky well, i can't actually close my own PR within a project (which updates to webpack 4 setup) as long as this plugin or ExtractTextPlugin doesn't work properly with incremental builds, contentHash and webpack 4. Pretty annoying actually, but can't really help either :/ |
// add contenthash support | ||
compiler.hooks.emit.tap(pluginName, (compilation) => { | ||
const regexp = /\[(?:(\w+):)?contenthash(?::([a-z]+\d*))?(?::(\d+))?\]/ig; | ||
Object.keys(compilation.assets).forEach((filename) => { |
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.
What about object.entries
?
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.
Not available in node 6.
[contenthash]
support
I'll add Thanks for your PR anyway. |
So would we then want to use |
Issues
First time doing webpack plugin code :) Hope it won't break anything.