forked from cybercongress/cyb-ts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.dev.js
32 lines (30 loc) · 918 Bytes
/
webpack.config.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
const webpack = require('webpack');
const { merge } = require('webpack-merge');
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
const commonConfig = require('./webpack.config.common');
module.exports = merge(commonConfig, {
mode: 'development',
devServer: {
https: true,
host: 'localhost',
port: process.env.PORT_APP || '3001',
hot: true,
// ngrok tunnel
allowedHosts: ['.ngrok-free.app'],
headers: {
'Access-Control-Allow-Origin': '*',
},
historyApiFallback: true,
},
plugins: [
// Only update what has changed on hot reload
new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({
...commonConfig.plugins.find(
(plugin) => plugin.constructor.name === 'DefinePlugin'
).definitions,
'process.env.IS_DEV': JSON.stringify(true),
}),
new ReactRefreshWebpackPlugin(),
],
});