-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.dev.js
40 lines (39 loc) · 983 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
33
34
35
36
37
38
39
40
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
mode: 'development',
devtool: 'inline-source-map',
entry: [
'react-hot-loader/patch',
'webpack-dev-server/client?http://0.0.0.0:3110',
'webpack/hot/only-dev-server',
'./src/index.tsx',
],
output: {
path: `${__dirname}/dist`,
publicPath: '/',
filename: 'app.js',
},
plugins: [
new webpack.NamedModulesPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development'),
}),
new HtmlWebpackPlugin({
template: `public/index.html`,
filename: 'index.html',
favicon: 'public/favicon.ico'
})
],
devServer: {
headers: { 'Access-Control-Allow-Origin': '*' },
https: false,
disableHostCheck: true,
host: '0.0.0.0',
port: 3110,
hot: true,
progress: true,
historyApiFallback: true,
},
};