From 1806dddba22695e0b6e90fc46bf14abec9d32ebf Mon Sep 17 00:00:00 2001 From: sunhao Date: Mon, 28 Oct 2019 17:51:27 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B0=83=E6=95=B4=20server=E7=AB=AF=20?= =?UTF-8?q?style=E6=A0=B7=E5=BC=8F=E5=8A=A0=E8=BD=BD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/style.webpack.ts | 37 ++++++++----------------------------- 1 file changed, 8 insertions(+), 29 deletions(-) diff --git a/src/utils/style.webpack.ts b/src/utils/style.webpack.ts index 126080a..8af47f8 100644 --- a/src/utils/style.webpack.ts +++ b/src/utils/style.webpack.ts @@ -24,15 +24,11 @@ export function getStyle( ? [ { test: /\.scss$/, - use: !isProd - ? ['vue-style-loader', 'css-loader', getSassLoader(sass)] - : ['null-loader'] + use: 'null-loader' }, { test: /\.css$/, - use: !isProd - ? ['vue-style-loader', 'css-loader'] - : ['null-loader'] + use: 'null-loader' } ] : [ @@ -46,31 +42,14 @@ export function getStyle( }, { test: /\.css$/, - use: [ - isProd ? MiniCssExtractPlugin.loader : 'vue-style-loader', - 'css-loader' - ] + use: [isProd ? MiniCssExtractPlugin.loader : 'vue-style-loader', 'css-loader'] } ] }, - optimization: { - splitChunks: { - cacheGroups: { - styles: { - name: 'styles', - test: /\.css$/, - chunks: 'all', - enforce: true - } - } - } - }, - plugins: isProd - ? [ - new MiniCssExtractPlugin({ - filename: '[contenthash].css' - }) - ] - : [] + plugins: [ + new MiniCssExtractPlugin({ + filename: '[contenthash].css' + }) + ] } }