From d2beab09769ffe845eebcc05e2957f96dd9e41cc Mon Sep 17 00:00:00 2001 From: muerwre Date: Thu, 21 Mar 2019 18:19:40 +0700 Subject: [PATCH] fixed css-loader hashing --- webpack.config.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 8e83560..6078850 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -20,12 +20,13 @@ const htmlPlugin = new HtmlWebPackPlugin({ favicon: 'src/sprites/favicon.png', }); +const isDevelopment = process.env.NODE_ENV !== 'production'; + const miniCssExractPlugin = new MiniCssExtractPlugin({ - filename: '[name].css', - chunkFilename: '[id].css' + filename: isDevelopment ? '[name].css' : '[name].[hash].css', + chunkFilename: isDevelopment ? '[id].css' : '[id].[hash].css', }); -const isDevelopment = process.env.NODE_ENV !== 'production'; const devtool = isDevelopment ? 'cheap-module-eval-source-map' : 'source-map'; // const flowPlugin = new FlowWebpackPlugin(); @@ -77,13 +78,7 @@ module.exports = () => { { test: /\.less$/, use: [ - { - loader: isDevelopment ? 'style-loader' : MiniCssExtractPlugin.loader, - options: { - filename: isDevelopment ? '[name].css' : '[name].[hash].css', - chunkFilename: isDevelopment ? '[id].css' : '[id].[hash].css', - } - }, + { loader: isDevelopment ? 'style-loader' : MiniCssExtractPlugin.loader }, // { loader: 'style-loader' }, { loader: 'css-loader' }, { loader: 'less-loader' }