-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.dev.config.js
48 lines (46 loc) · 1.13 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
47
48
const { merge } = require('webpack-merge')
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin')
const ESLintPlugin = require('eslint-webpack-plugin')
const commonConfig = require('./webpack.base.config')
module.exports = () => {
return merge(commonConfig, {
mode: 'development',
output: {
filename: '[name].js',
chunkFilename: '[name].chunk.js'
},
devtool: 'eval-cheap-module-source-map',
optimization: {
runtimeChunk: true,
removeAvailableModules: false,
removeEmptyChunks: false,
splitChunks: false
},
devServer: {
port: 3000,
open: true,
hot: true,
historyApiFallback: true
},
module: {
rules: [
{
test: /\.(css)$/,
exclude: /node_modules/,
use: ['style-loader', 'css-loader']
},
{
test: /\.(s(a|c)ss)$/,
exclude: /node_modules/,
use: ['style-loader', 'css-loader', 'sass-loader']
}
]
},
plugins: [
new ESLintPlugin(),
new ReactRefreshWebpackPlugin({
overlay: false
})
]
})
}