Skip to content

Commit 4112920

Browse files
committed
fix: add empty id to prevent contenthash from changing unnecessarily
1 parent aa993da commit 4112920

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class CssDependencyTemplate {
4242
class CssModule extends webpack.Module {
4343
constructor(dependency) {
4444
super(MODULE_TYPE, dependency.context);
45+
this.id = '';
4546
this._identifier = dependency.identifier;
4647
this._identifierIndex = dependency.identifierIndex;
4748
this.content = dependency.content;
@@ -92,7 +93,7 @@ class CssModule extends webpack.Module {
9293
super.updateHash(hash);
9394
hash.update(this.content);
9495
hash.update(this.media || '');
95-
hash.update(JSON.stringify(this.sourceMap || ''));
96+
hash.update(this.sourceMap ? JSON.stringify(this.sourceMap) : '');
9697
}
9798
}
9899

0 commit comments

Comments
 (0)