-
-
Notifications
You must be signed in to change notification settings - Fork 184
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
assets generated from the child compiler whose key has hash in the manifest.json #210
Labels
Comments
Experiencing the same problem with |
Any updates??. As html-webpack-plugin v4 support index.[contenthash].html, See Long Term Caching |
I have implemented a workaround for const merge = require('merge-deep');
module.exports = {
plugins: [
new ManifestPlugin({
map: (fileDescriptor) => {
const { name } = fileDescriptor;
// Removes the ".[contenthash]" part from name
return merge(fileDescriptor, { name: name.replace(/(\.[a-f0-9]+)(\.[a-z]{2,})$/, '$2') });
},
}),
new CopyPlugin({
patterns: [{ from: 'src/img/**/*', to: 'img/[name].[contenthash].[ext]' }],
}),
],
} |
@peschee thanks for adding that workaround. For v3.0.0 we'll implement that fix behind an option that's default to true. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, the
webpack-manifest-plugin
does not support extracting the asset chunk name from the child compiler.Here is part of my
webpack.config.js
And here is the actual output
The expected output
In this output, how to we know the filename after the build without a stable key name.
And you will say that this is the issue on
html-webpack-plugin
. You are partially correct. Basically there are two issues right here. One is onhtml-webpack-plugin
because it does not name the chunk. The other one is onwebpack-manifest-plugin
. Even ifhtml-webpack-plugin
name the chunk correctly,webpack-manifest-plugin
won't be able to extract the chunk name as the key in the manifest.jsonBecause the key,
index.c5a9bff71fdfed9b6046.html
, was extracted from this logic https://github.com/danethurber/webpack-manifest-plugin/blob/b55ac5d7748dde89fd0225e13263c7b42b1dca87/lib/plugin.js#L115-L141. Child compiler can have the entry name. I thinkwebpack-manifest-plugin
should respect that if the chunks in child compiler have name.The correct logic should recursively extract all the chunks from parent compilation to all children compilation
The following logic should be called recursively
https://github.com/danethurber/webpack-manifest-plugin/blob/b55ac5d7748dde89fd0225e13263c7b42b1dca87/lib/plugin.js#L87-L111
Please do not judge if the index.[contenthash].html makes sense.
worker-loader
is also a good counter example.The text was updated successfully, but these errors were encountered: