-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.dev.js
42 lines (39 loc) · 1.04 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
const webpack = require('webpack');
const { merge } = require('webpack-merge');
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
const common = require('./webpack.common.js');
const hotReload = !!process.env.HOT_RELOAD;
module.exports = merge(common, {
devServer: {
historyApiFallback: true,
disableHostCheck: true,
host: '0.0.0.0',
port: process.env.QGRAPH_PORT,
hot: hotReload,
inline: hotReload,
},
devtool: 'cheap-module-eval-source-map',
mode: 'development',
module: {
rules: [
{
test: /\.[jt]sx?$/,
exclude: /node_modules/,
use: [
{
loader: require.resolve('babel-loader'),
options: {
plugins: [
hotReload && require.resolve('react-refresh/babel'),
].filter(Boolean),
},
},
],
},
],
},
plugins: [
hotReload && new webpack.HotModuleReplacementPlugin(),
hotReload && new ReactRefreshWebpackPlugin(),
].filter(Boolean),
});