Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 26.9k
Added app name as hash salt for css modules ident#12013
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
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -22,11 +22,15 @@ module.exports = function getLocalIdent( | ||
| ) | ||
| ? '[folder]' | ||
| : '[name]'; | ||
| // Create a hash based on a the file location and class name. Will be unique across a project, and close to globally unique. | ||
| // Create a hash based on the relative file location, class name and hashSalt (if given). | ||
| // Will be unique across a project and globally unique with a suitable hashSalt. | ||
| const hashSalt = options.hashSalt || ''; | ||
| const hash = loaderUtils.getHashDigest( | ||
| path.posix.relative(context.rootContext, context.resourcePath) + localName, | ||
| hashSalt + | ||
| path.posix.relative(context.rootContext, context.resourcePath) + | ||
| localName, | ||
| 'md5', | ||
| 'base64', | ||
| 'base64url', | ||
Author There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixes #11775. | ||
| 5 | ||
| ); | ||
| // Use loaderUtils to find the file or folder name | ||
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.
With ccs-loader v6 / webpack v5 hashPrefix was removed in favor of hashSalt. hashSalt is undefined by default.