File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,8 @@ export default class OptimizePlugin {
136136 let transformed ;
137137 try {
138138 transformed = await Promise . all ( files . map ( file => {
139- if ( ! file . endsWith ( 'js' ) ) return undefined ;
139+ // ignore non-JS files
140+ if ( ! file . match ( / \. m ? [ j t ] s x ? $ / i) ) return undefined ;
140141 const asset = compilation . assets [ file ] ;
141142 let pending = processing . get ( asset ) ;
142143 if ( pending ) return pending ;
@@ -405,7 +406,7 @@ export default class OptimizePlugin {
405406
406407 /** @todo Support other file extensions */
407408 toLegacyFilename ( file ) {
408- let out = file . replace ( / ( \. m ? j s ) $ / g, '.legacy$1' ) ;
409+ let out = file . replace ( / ( \. m ? [ j t ] s x ? ) $ / g, '.legacy$1' ) ;
409410 if ( out === file ) {
410411 // this will create `foo.js.legacy.js`, but it's the best we can hope for.
411412 out += '.legacy.js' ;
You can’t perform that action at this time.
0 commit comments