-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.prod.js
36 lines (34 loc) · 994 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
36
/*
* @Author: [email protected]
* @Date: 2018-09-02 20:52:11
* @Last Modified by: [email protected]
* @Last Modified time: 2018-09-04 11:18:31
*/
const WebpackMerge = require("webpack-merge");
const CommonConfig = require('./webpack.common')
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = WebpackMerge(CommonConfig, {
mode: 'production',
module: {
rules: [
{
test: /\.css$/,
use: [MiniCssExtractPlugin.loader, "css-loader"]
},
{
test: /\.less$/,
use: [MiniCssExtractPlugin.loader, "css-loader", 'less-loader']
},
{
test: /\.s(a|c)ss$/,
use: [MiniCssExtractPlugin.loader,"css-loader","sass-loader"]
}
]
},
plugins: [
new MiniCssExtractPlugin({
filename: "[name].css",
chunkFilename: "[id].css"
})
]
})