@@ -85,14 +85,15 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
8585 this . set ( "output.filename" , "[name].js" ) ;
8686 this . set ( "output.chunkFilename" , "make" , options => {
8787 const filename = options . output . filename ;
88- if ( typeof filename === "function" ) return filename ;
89- const hasName = filename . includes ( "[name]" ) ;
90- const hasId = filename . includes ( "[id]" ) ;
91- const hasChunkHash = filename . includes ( "[chunkhash]" ) ;
92- // Anything changing depending on chunk is fine
93- if ( hasChunkHash || hasName || hasId ) return filename ;
94- // Elsewise prefix "[id]." in front of the basename to make it changing
95- return filename . replace ( / ( ^ | \/ ) ( [ ^ / ] * (?: \? | $ ) ) / , "$1[id].$2" ) ;
88+ if ( typeof filename !== "function" ) {
89+ const hasName = filename . includes ( "[name]" ) ;
90+ const hasId = filename . includes ( "[id]" ) ;
91+ const hasChunkHash = filename . includes ( "[chunkhash]" ) ;
92+ // Anything changing depending on chunk is fine
93+ if ( hasChunkHash || hasName || hasId ) return filename ;
94+ // Elsewise prefix "[id]." in front of the basename to make it changing
95+ return filename . replace ( / ( ^ | \/ ) ( [ ^ / ] * (?: \? | $ ) ) / , "$1[id].$2" ) ;
96+ }
9697 } ) ;
9798 this . set ( "output.webassemblyModuleFilename" , "[modulehash].module.wasm" ) ;
9899 this . set ( "output.library" , "" ) ;
0 commit comments