Skip to content
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

contenthash generates same filename for different contents #454

Closed
zlk89 opened this issue Oct 15, 2019 · 9 comments · Fixed by #702
Closed

contenthash generates same filename for different contents #454

zlk89 opened this issue Oct 15, 2019 · 9 comments · Fixed by #702

Comments

@zlk89
Copy link

zlk89 commented Oct 15, 2019

  • Operating System: macOS 10.14.6
  • Node Version: v8.11.2
  • NPM Version: 6.0.1
  • webpack Version: 4.41.2
  • mini-css-extract-plugin Version: 0.8.0

Expected Behavior

Should generate different filename when content is changed.

Actual Behavior

Same filename was generated when content is updated.

How Do We Reproduce?

https://github.com/zlk89/webpack-css-contenthash-diff

  • yarn to install packages
  • yarn build
  • under dist folder, you will find two css files with same content hash, while content is different.

Basically contenthash is same, when import statement order is different:

// in js
@import 'a.scss';
@import 'b.scss';
// in js
@import 'b.scss';
@import 'a.scss';
@alexander-akait
Copy link
Member

Please create reproducible test repo

@zlk89
Copy link
Author

zlk89 commented Oct 17, 2019

@evilebottnawi updated description with a minimal reproducible repo and steps

@alexander-akait
Copy link
Member

Send a fix, thanks for the PR

@zlk89
Copy link
Author

zlk89 commented Mar 12, 2020

@evilebottnawi any update? We are getting this issue again

@alexander-akait
Copy link
Member

@zlk89 no right now, but will be fixed in near future

@zlk89
Copy link
Author

zlk89 commented Dec 5, 2020

@alexander-akait looks like the issue is still existed. I have bumped the repo to latest webpack (v5.10) and mini css extract plugin (v1.3.2)

@alexander-akait
Copy link
Member

@zlk89 Yep, a lot of work, but it in my TODO, sorry 😞

@zlk89
Copy link
Author

zlk89 commented Feb 5, 2021

^ bump, this bug essentially prevents us from utilizing long term cache on all css generated by this plugin

@zlk89
Copy link
Author

zlk89 commented Feb 22, 2021

verified the bug has been fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants