@@ -121,7 +121,7 @@ function cloneRule (rule, normalizedRule) {
121
121
}
122
122
return true
123
123
} ,
124
- use : normalizedRule . use ? normalizedRule . use . map ( reuseIdent ) : undefined
124
+ use : normalizedRule . use ? normalizedRule . use . map ( cleanIdent ) : undefined
125
125
} )
126
126
127
127
// delete shorthand since we have normalized use
@@ -138,16 +138,15 @@ function cloneRule (rule, normalizedRule) {
138
138
return res
139
139
}
140
140
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 /
145
142
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
+ }
151
150
delete use . ident
152
151
}
153
152
return use
0 commit comments