-
-
Notifications
You must be signed in to change notification settings - Fork 388
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
Content hashes change based on entry order #281
Comments
entry: {
file1: './file1.scss'
file2: './file2.scss',
file3: './file3.scss'
} (S)CSS (non-JS) entries aren't supported by
entry: {
app: './entry.js'
} |
@michael-ciniawsky It's the same issue. I can't have 1 single entry: {
file1: './file1.js',
file2: './file2.js',
file3: './file3.js'
} Where each js file does a |
It was just an example... Still you need to import the CSS into the JS file (per route)
|
@michael-ciniawsky I took a quick look and it's unclear to me what the |
if (m.type === MODULE_TYPE) {
m.updateHash(hash);
} https://github.com/webpack-contrib/mini-css-extract-plugin/blob/master/src/index.js#L91-L96 updateHash(hash) {
super.updateHash(hash); // <= 1.
hash.update(this.content);
hash.update(this.media || '');
hash.update(JSON.stringify(this.sourceMap || ''));
} https://github.com/webpack/webpack/blob/master/lib/Module.js#L310-L314 updateHash(hash) {
hash.update(`${this.id}`); // <= 2.
hash.update(JSON.stringify(this.usedExports)); // <= 3.
super.updateHash(hash);
}
Yeah, I think you found a bug here :). You're right to be under the impression that |
@michael-ciniawsky I created a repo here: https://github.com/lfre/mini-css-extract-plugin-contenthash/. Instructions are in README and a comment: https://github.com/lfre/mini-css-extract-plugin-contenthash/blob/master/webpack.config.js#L10 The issue is |
I will take a look, but it's already clear that there is an issue and I will ping folks in slack to take a look at this aswell, ideally Tobias (sokra) give us some insights on why adding the |
I think in this case |
Thanks for looking into it @michael-ciniawsky @sokra. I opened a PR to fix it, I'd appreciate any feedback on updating the tests. Thanks! |
Compiling
scss
tocss
, I noticed that thecontenthash
on files changed when a new entry was added before, even though the content of the files have not changed. Without this plugin, thecontenthash
in the JS files remain the same regardless of order, which tells me it's not webpack, or sass-loader.Any help is appreciated. Find the minimal reproduce scenario below:
Node: 8.12.0 (LTS)
Plugin: 0.4.3
css-loader: 1.0.0
sass-loader: 7.1.0
Webpack: 4.19.1
The text was updated successfully, but these errors were encountered: