Skip to content

Commit b36eb07

Browse files
committed
Avoid style import duplication when extracted (fix #139)
Ensure non-scoped style imports have the same identifier by only adding style-rewriter query parameters when the style is scoped, becuase extract-text-webpack-plugin relies on the module identifier for dedupe.
1 parent cf7ae96 commit b36eb07

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/loader.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ module.exports = function (content) {
110110
}
111111

112112
function getRewriter (type, scoped) {
113-
var meta = '?id=' + moduleId + '&file=' + fileName
113+
var meta = '?id=' + moduleId
114114
switch (type) {
115115
case 'template':
116116
return scoped ? (rewriters.template + meta + '!') : ''
117117
case 'style':
118-
return rewriters.style + meta + (scoped ? '&scoped=true!' : '!')
118+
return rewriters.style + (scoped ? meta + '&scoped=true!' : '!')
119119
default:
120120
return ''
121121
}

0 commit comments

Comments
 (0)