Skip to content

Commit 50689e1

Browse files
fix: use full local ident (not mangled) for hashing (#20199)
1 parent 04cd530 commit 50689e1

File tree

8 files changed

+1040
-1044
lines changed

8 files changed

+1040
-1044
lines changed

.changeset/curly-mice-enjoy.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"webpack": patch
3+
---
4+
5+
Use the fully qualified class name (or export name) for `[fullhash]` placeholder in CSS modules.

.changeset/fifty-poets-play.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
"webpack": minor
33
---
44

5-
Handle more at-rules for CSS modules
5+
Handle more at-rules for CSS modules.

.changeset/proud-worms-promise.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
"webpack": patch
33
---
44

5-
Improve types
5+
Improve types.

lib/dependencies/CssIcssExportDependency.js

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -308,29 +308,19 @@ CssIcssExportDependency.Template = class CssIcssExportDependencyTemplate extends
308308
CssIcssExportDependency.INTERPOLATION_MODE.NAME ||
309309
dep.interpolationMode === CssIcssExportDependency.INTERPOLATION_MODE.VALUE
310310
) {
311-
const { module: m, moduleGraph, runtime } = templateContext;
311+
const { module: m } = templateContext;
312312
const module = /** @type {CssModule} */ (m);
313313
const generator = /** @type {CssGenerator} */ (module.generator);
314-
const names = dep.getExportsConventionNames(
314+
const local = dep.getExportsConventionNames(
315315
dep.interpolationMode ===
316316
CssIcssExportDependency.INTERPOLATION_MODE.NAME
317317
? dep.name
318318
: dep.value,
319319
/** @type {CssGeneratorExportsConvention} */
320320
(generator.options.exportsConvention)
321-
);
322-
const usedNames =
323-
/** @type {string[]} */
324-
(
325-
names
326-
.map((name) =>
327-
moduleGraph.getExportInfo(module, name).getUsedName(name, runtime)
328-
)
329-
.filter(Boolean)
330-
);
331-
const local = usedNames.length === 0 ? names[0] : usedNames[0];
321+
)[0];
332322
const prefix =
333-
/** @type {CssIcssExportDependency & { prefix: string }} */
323+
/** @type {CssIcssExportDependency & { prefix?: string }} */
334324
(dependency).prefix;
335325

336326
return (

0 commit comments

Comments
 (0)