diff --git a/packages/scripts/config/fix-style-webpack-plugin/index.js b/packages/scripts/config/fix-style-webpack-plugin/index.js index b7182375c1aa3..94127e52dc30e 100644 --- a/packages/scripts/config/fix-style-webpack-plugin/index.js +++ b/packages/scripts/config/fix-style-webpack-plugin/index.js @@ -28,7 +28,10 @@ class FixStyleWebpackPlugin { } const file = `${ chunk.name }.js`; - const styleFile = `style-${ chunk.name }.js`; + const styleFile = chunk.name.replace( + /(\/?)([^/]+?)$/, + '$1style-$2.js' + ); const styleFileAsset = compilation.getAsset( styleFile );