File tree 1 file changed +11
-7
lines changed 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -131,14 +131,18 @@ class MiniCssExtractPlugin {
131
131
if ( ! this . options . chunkFilename ) {
132
132
const { filename } = this . options ;
133
133
// Anything changing depending on chunk is fine
134
- if ( typeof filename === 'string' && REGEXP_PLACEHOLDERS . test ( filename ) ) {
135
- this . options . chunkFilename = filename ;
134
+ if ( typeof filename === 'string' ) {
135
+ if ( REGEXP_PLACEHOLDERS . test ( filename ) ) {
136
+ this . options . chunkFilename = filename ;
137
+ } else {
138
+ // Elsewise prefix '[id].' in front of the basename to make it changing
139
+ this . options . chunkFilename = filename . replace (
140
+ / ( ^ | \/ ) ( [ ^ / ] * (?: \? | $ ) ) / ,
141
+ '$1[id].$2'
142
+ ) ;
143
+ }
136
144
} else {
137
- // Elsewise prefix '[id].' in front of the basename to make it changing
138
- this . options . chunkFilename = DEFAULT_FILENAME . replace (
139
- / ( ^ | \/ ) ( [ ^ / ] * (?: \? | $ ) ) / ,
140
- '$1[id].$2'
141
- ) ;
145
+ this . options . chunkFilename = `[id].${ DEFAULT_FILENAME } ` ;
142
146
}
143
147
}
144
148
}
You can’t perform that action at this time.
0 commit comments