-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathwebpack.dev.config.js
46 lines (43 loc) · 1.17 KB
/
webpack.dev.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
44
45
46
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: '//localhost:3005/build/',
filename: '[name].js'
};
const conf = {
...commonConfig,
output,
plugins: [
...commonConfig.plugins,
new MiniCssExtractPlugin({
filename: '[name].css',
chunkFilename: '[id].css',
ignoreOrder: false,
}),
],
devtool: 'source-map',
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',
],
}, )
},
devServer: {
historyApiFallback: true,
contentBase: './src',
port: 3005
}
}
module.exports = conf;