-
Notifications
You must be signed in to change notification settings - Fork 5
/
webpack.prod.js
35 lines (34 loc) · 943 Bytes
/
webpack.prod.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
var config = require('./webpack.config')
var merge = require('webpack-merge')
var MiniCssExtractPlugin = require('mini-css-extract-plugin')
var OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin')
var UglifyJsPlugin = require('uglifyjs-webpack-plugin')
module.exports = merge(config, {
mode: 'production',
plugins: [
new MiniCssExtractPlugin()
],
devtool: 'source-map',
module: {
rules: [
{
test: /\.s?css$/,
use: [
MiniCssExtractPlugin.loader,
'css-loader?importLoaders=1',
'sass-loader'
]
},
]
},
optimization: {
minimizer: [
new OptimizeCssAssetsPlugin(),
new UglifyJsPlugin({
cache: true,
parallel: true,
sourceMap: true
})
]
}
})