-
-
Notifications
You must be signed in to change notification settings - Fork 604
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
Setting sourceMap: true generates different content hashes on Linux vs MacOS #886
Comments
Thanks for issue, i will investigate this in near future, but i think problem not in |
It is very possible the problem is in Webpack itself. I looked through the code for Note I have not tried this in Webpack v5 alpha as MiniCssExtractPlugin and HtmlWebpackPlugin are not yet compatible |
@wingrunr21 after investigate i find problem: With
Without
So content hashes are difference. Problem on side We should respect |
You can comment hash.update(this.sourceMap ? JSON.stringify(this.sourceMap) : ''); And see what if (pluginOptions.sourceMap) {
hash.update(this.sourceMap ? JSON.stringify(this.sourceMap) : '');
} |
@evilebottnawi I don't believe that will fix the problem: A) doesn't the ternary already respect the |
Unfortunately we have problems with source maps and paths in |
I can try to dig into this but it looks like this has been reported for awhile. Would you mind re-opening this issue as it is not in fact resolved. |
@wingrunr21 |
Yep, that seems right. I'll see if I have time to dig into it. Looks like there are a few example repos with reproduction steps. |
@evilebottnawi Upon looking at this closer, fixes across the various loaders have been submitted already. #753 addresses it for this project |
@wingrunr21 invalid fix and break source maps |
To solve this problem we should:
|
Working on this problem #1031, found what it is happens only with |
Let's close in favor #622, source map improvements will be after stable |
Expected Behavior
The generated
contenthash
for a CSS file is consistent with the content of the file.Actual Behavior
The generated
contenthash
differs depending on which operating system Webpack is run on.I have tried various combinations of adding removing loaders before/after the
css-loader
(including usingstyle-loader
instead ofMiniCssExtractPlugin
) and the addition/removal of thesourceMap
option incss-loader
is the thing that triggers this to occur.The files in the various operating systems have the exact same content. This was verified by generating an MD5 hash of the CSS file.
Code
How Do We Reproduce?
Please see my example repo
There's a CircleCI build configured where you can see the "good" and "bad" webpack config running. If you take a look at the generated contenthash (and compare against a compilation on a Mac), you can see they are different
For my Mac, the "good" output is
main.faf79bb5bf2915fa1fb9.css
and the "bad" output ismain.a2f311c836bf5e7db183.css
.Contrast this with the Linux build in CircleCI:
"good" output is
main.faf79bb5bf2915fa1fb9.css
as expected"bad" output is
main.64ea49633b59dce4de34.css
which differs from the MacOS build.The text was updated successfully, but these errors were encountered: