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

WRR-8543: Changed CSS classnames to be hashed when production build #361

Merged
merged 3 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## unreleased

### pack

* Changed classnames to be hashed when production build.

## 7.0.0-alpha.3 (December 12, 2024)

### pack
Expand Down
15 changes: 9 additions & 6 deletions config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ module.exports = function (
use: getStyleLoaders({
importLoaders: 1,
modules: {
getLocalIdent
...(isEnvProduction ? {} : {getLocalIdent})
}
})
},
Expand All @@ -346,7 +346,8 @@ module.exports = function (
use: getStyleLoaders({
importLoaders: 1,
modules: {
...(app.forceCSSModules ? {getLocalIdent} : {mode: 'icss'})
...(app.forceCSSModules ? {} : {mode: 'icss'}),
...(!app.forceCSSModules && isEnvProduction ? {} : {getLocalIdent})
}
}),
// Don't consider CSS imports dead code even if the
Expand All @@ -360,7 +361,7 @@ module.exports = function (
use: getLessStyleLoaders({
importLoaders: 2,
modules: {
getLocalIdent
...(isEnvProduction ? {} : {getLocalIdent})
}
})
},
Expand All @@ -369,7 +370,8 @@ module.exports = function (
use: getLessStyleLoaders({
importLoaders: 2,
modules: {
...(app.forceCSSModules ? {getLocalIdent} : {mode: 'icss'})
...(app.forceCSSModules ? {} : {mode: 'icss'}),
...(!app.forceCSSModules && isEnvProduction ? {} : {getLocalIdent})
}
}),
sideEffects: true
Expand All @@ -381,7 +383,7 @@ module.exports = function (
use: getScssStyleLoaders({
importLoaders: 3,
modules: {
getLocalIdent
...(isEnvProduction ? {} : {getLocalIdent})
}
})
},
Expand All @@ -391,7 +393,8 @@ module.exports = function (
use: getScssStyleLoaders({
importLoaders: 3,
modules: {
...(app.forceCSSModules ? {getLocalIdent} : {mode: 'icss'})
...(app.forceCSSModules ? {} : {mode: 'icss'}),
...(!app.forceCSSModules && isEnvProduction ? {} : {getLocalIdent})
}
})
},
Expand Down