-
Notifications
You must be signed in to change notification settings - Fork 146
/
Copy pathwebpack.dev.js
50 lines (49 loc) · 1.17 KB
/
webpack.dev.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
49
50
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
const commonPaths = require('./paths');
module.exports = {
mode: 'development',
output: {
filename: '[name].js',
path: commonPaths.outputPath,
chunkFilename: '[name].js',
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
loader: 'babel-loader',
exclude: /(node_modules)/,
options: {
presets: ['@babel/react'],
plugins: [
['import', { libraryName: 'antd', style: true }],
require.resolve('react-refresh/babel'),
].filter(Boolean),
},
},
{
test: /\.(css|scss)$/,
use: [
'style-loader',
{
loader: 'css-loader',
options: {
sourceMap: true,
localsConvention: 'camelCase',
modules: {
localIdentName: '[local]___[hash:base64:5]',
},
},
},
'sass-loader',
],
},
],
},
devServer: {
contentBase: commonPaths.outputPath,
compress: true,
hot: true,
},
plugins: [new ReactRefreshWebpackPlugin()],
};