From a939ba775feebad57268ca91be0178ee116fbd7e Mon Sep 17 00:00:00 2001 From: Joel Chen Date: Fri, 24 Jan 2020 12:46:07 -0800 Subject: [PATCH] fix style bundle filename in dev mode --- .../config/webpack/partial/extract-style.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/electrode-archetype-react-app-dev/config/webpack/partial/extract-style.js b/packages/electrode-archetype-react-app-dev/config/webpack/partial/extract-style.js index 9981f1b2b..29b92ee56 100644 --- a/packages/electrode-archetype-react-app-dev/config/webpack/partial/extract-style.js +++ b/packages/electrode-archetype-react-app-dev/config/webpack/partial/extract-style.js @@ -196,12 +196,15 @@ module.exports = function() { }); } + const styleBundleFilename = + process.env.WEBPACK_DEV || archetype.babel.hasMultiTargets + ? "[name].style.css" + : "[name].style.[contenthash].css"; + return { module: { rules }, plugins: [ - new MiniCssExtractPlugin({ - filename: archetype.babel.hasMultiTargets ? "[name].style.css" : "[name].style.[contenthash].css" - }), + new MiniCssExtractPlugin({ filename: styleBundleFilename }), isProduction && new OptimizeCssAssetsPlugin(archetype.webpack.optimizeCssOptions), new webpack.LoaderOptionsPlugin({ minimize: true,