From f400202b3aeeafbde8de021875881ad0244649b9 Mon Sep 17 00:00:00 2001 From: Mikyung Kim Date: Thu, 19 Dec 2024 15:22:50 +0900 Subject: [PATCH 1/2] WRR-8543: Changed CSS classnames to be hashed when production build (#361) * WRR-8543: Changed CSS classname to be hash based when production build Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com) * Added a changelog Enact-DCO-1.0-Signed-off-by: Mikyung Kim (mikyung27.kim@lge.com) --- CHANGELOG.md | 6 ++++++ config/webpack.config.js | 15 +++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae3f597a..ec692e70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## unreleased + +### pack + +* Changed classnames to be hashed when production build. + ## 7.0.0-alpha.3 (December 12, 2024) ### pack diff --git a/config/webpack.config.js b/config/webpack.config.js index 5f379b8d..70df2c8d 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -335,7 +335,7 @@ module.exports = function ( use: getStyleLoaders({ importLoaders: 1, modules: { - getLocalIdent + ...(isEnvProduction ? {} : {getLocalIdent}) } }) }, @@ -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 @@ -360,7 +361,7 @@ module.exports = function ( use: getLessStyleLoaders({ importLoaders: 2, modules: { - getLocalIdent + ...(isEnvProduction ? {} : {getLocalIdent}) } }) }, @@ -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 @@ -381,7 +383,7 @@ module.exports = function ( use: getScssStyleLoaders({ importLoaders: 3, modules: { - getLocalIdent + ...(isEnvProduction ? {} : {getLocalIdent}) } }) }, @@ -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}) } }) }, From dbd627691b31531b188c2dbf46c4d2f31f8879d3 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 1 Jan 2025 07:17:20 +0000 Subject: [PATCH 2/2] update license Let's keep legal happy. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dd1f37d3..1707bba9 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,7 @@ npm uninstall -g eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-bab Unless otherwise specified, all content, including all source code files and documentation files in this repository are: -Copyright (c) 2016-2024 LG Electronics +Copyright (c) 2016-2025 LG Electronics Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at