Skip to content

Commit

Permalink
Merge pull request #17444 from burhanuday/fix/css-unused-identifiers
Browse files Browse the repository at this point in the history
fix: unused identifiers should retain names when using css modules
  • Loading branch information
TheLarkInn authored Jul 12, 2023
2 parents 6be4065 + a9cbd06 commit 066cd49
Show file tree
Hide file tree
Showing 9 changed files with 2,655 additions and 3 deletions.
3 changes: 3 additions & 0 deletions lib/dependencies/CssLocalIdentifierDependency.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ CssLocalIdentifierDependency.Template = class CssLocalIdentifierDependencyTempla
const used = moduleGraph
.getExportInfo(module, dep.name)
.getUsedName(dep.name, runtime);

if (!used) return;

const moduleId = chunkGraph.getModuleId(module);
const identifier =
dep.prefix +
Expand Down
Loading

0 comments on commit 066cd49

Please sign in to comment.