File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ const pluginName = 'mini-css-extract-plugin';
16
16
const REGEXP_CHUNKHASH = / \[ c h u n k h a s h (?: : ( \d + ) ) ? \] / i;
17
17
const REGEXP_CONTENTHASH = / \[ c o n t e n t h a s h (?: : ( \d + ) ) ? \] / i;
18
18
const REGEXP_NAME = / \[ n a m e \] / i;
19
- const REGEXP_PLACEHOLDERS = / \[ ( n a m e | i d | c h u n k h a s h ) \] / g;
20
19
const DEFAULT_FILENAME = '[name].css' ;
21
20
22
21
class CssDependency extends webpack . Dependency {
@@ -131,9 +130,12 @@ class MiniCssExtractPlugin {
131
130
132
131
if ( ! this . options . chunkFilename ) {
133
132
const { filename } = this . options ;
133
+ const hasName = filename . includes ( '[name]' ) ;
134
+ const hasId = filename . includes ( '[id]' ) ;
135
+ const hasChunkHash = filename . includes ( '[chunkhash]' ) ;
134
136
135
137
// Anything changing depending on chunk is fine
136
- if ( REGEXP_PLACEHOLDERS . test ( filename ) ) {
138
+ if ( hasChunkHash || hasName || hasId ) {
137
139
this . options . chunkFilename = filename ;
138
140
} else {
139
141
// Elsewise prefix '[id].' in front of the basename to make it changing
You can’t perform that action at this time.
0 commit comments