-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.dev.js
40 lines (38 loc) · 1.06 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
const { merge, mergeWithRules } = require('webpack-merge');
const { DefinePlugin } = require('webpack');
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
const ESLintWebpackPlugin = require('eslint-webpack-plugin');
const common = require('./webpack.common');
module.exports = merge(common, {
mode: 'development',
devtool: 'cheap-module-source-map',
devServer: {
headers: {
'Cross-Origin-Opener-Policy': 'same-origin',
'Cross-Origin-Embedder-Policy': 'require-corp',
},
client: {
overlay: {
errors: true,
warnings: false,
},
},
},
plugins: [
new DefinePlugin({ __VERSION__: JSON.stringify('edge') }),
new ReactRefreshWebpackPlugin(),
new ESLintWebpackPlugin({
extensions: ['js', 'mjs', 'jsx', 'ts', 'tsx'],
}),
],
module: {
rules: [
mergeWithRules({
test: 'match',
use: { loader: 'match', options: 'merge' },
})(common.module.rules[0], {
use: { options: { plugins: ['react-refresh/babel'] } },
}),
],
},
});