Skip to content

Commit

Permalink
feat: 调整 server端 style样式加载问题
Browse files Browse the repository at this point in the history
  • Loading branch information
imsunhao committed Oct 28, 2019
1 parent 94d01bb commit 1806ddd
Showing 1 changed file with 8 additions and 29 deletions.
37 changes: 8 additions & 29 deletions src/utils/style.webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
]
: [
Expand All @@ -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'
})
]
}
}

0 comments on commit 1806ddd

Please sign in to comment.