Skip to content

Commit 066cd49

Browse files
authored
Merge pull request #17444 from burhanuday/fix/css-unused-identifiers
fix: unused identifiers should retain names when using css modules
2 parents 6be4065 + a9cbd06 commit 066cd49

File tree

9 files changed

+2655
-3
lines changed

9 files changed

+2655
-3
lines changed

lib/dependencies/CssLocalIdentifierDependency.js

+3
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ CssLocalIdentifierDependency.Template = class CssLocalIdentifierDependencyTempla
109109
const used = moduleGraph
110110
.getExportInfo(module, dep.name)
111111
.getUsedName(dep.name, runtime);
112+
113+
if (!used) return;
114+
112115
const moduleId = chunkGraph.getModuleId(module);
113116
const identifier =
114117
dep.prefix +

0 commit comments

Comments
 (0)