@@ -121,7 +121,7 @@ function cloneRule (rule, normalizedRule) {
121121 }
122122 return true
123123 } ,
124- use : normalizedRule . use ? normalizedRule . use . map ( reuseIdent ) : undefined
124+ use : normalizedRule . use ? normalizedRule . use . map ( cleanIdent ) : undefined
125125 } )
126126
127127 // delete shorthand since we have normalized use
@@ -138,16 +138,15 @@ function cloneRule (rule, normalizedRule) {
138138 return res
139139}
140140
141- // Some loaders like babel-loader passes its own option directly to babel
142- // and since babel validates the options, "ident" would cause an unknown option
143- // error. For these loaders we'll bail out on the ident reuse.
144- const reuseIdentBlackList = / b a b e l - l o a d e r /
141+ const reuseIdentWhitelist = / c s s - l o a d e r /
145142
146- // Reuse options ident, so that imports from within css-loader would get the
147- // exact same request prefixes, avoiding duplicated modules (#1199)
148- function reuseIdent ( use ) {
149- if ( use . ident && ! reuseIdentBlackList . test ( use . loader ) ) {
150- use . options . ident = use . ident
143+ function cleanIdent ( use ) {
144+ if ( use . ident ) {
145+ if ( reuseIdentWhitelist . test ( use . loader ) ) {
146+ // Reuse options ident, so that imports from within css-loader would get the
147+ // exact same request prefixes, avoiding duplicated modules (#1199)
148+ use . options . ident = use . ident
149+ }
151150 delete use . ident
152151 }
153152 return use
0 commit comments