-
Notifications
You must be signed in to change notification settings - Fork 40
/
webpack.config.js
43 lines (40 loc) · 1.11 KB
/
webpack.config.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
37
38
39
40
41
42
43
const path = require('path');
const commonConfig = require('./webpack.common.config');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const output = {
path: path.resolve(__dirname, 'build'),
publicPath: './',
filename: '[name].js'
};
const conf = Object.assign(commonConfig, {
output,
plugins: [
...commonConfig.plugins,
new MiniCssExtractPlugin({
filename: '[name].css',
chunkFilename: '[id].css',
ignoreOrder: false,
}),
],
module: {
rules: commonConfig.module.rules.concat({
test: /\.s?css$/,
use: [{
loader: MiniCssExtractPlugin.loader,
options: {
publicPath: output.publicPath,
hmr: process.env.NODE_ENV === 'development',
},
},
'css-loader',
'postcss-loader',
'sass-loader',
],
}, )
},
optimization: {
concatenateModules: true,
minimize: true,
},
});
module.exports = conf;