-
Notifications
You must be signed in to change notification settings - Fork 40
/
webpack.dev.js
45 lines (43 loc) · 1.28 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
const webpack = require('webpack')
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin')
const path = require('path')
const {
commonLoaders,
styleLoader,
HTMLPlugins,
default: common,
} = require('./webpack.common')
module.exports = {
...common,
devtool: 'eval-source-map',
module: {
rules: [...commonLoaders('development'), styleLoader('style-loader')],
},
devServer: {
historyApiFallback: true,
static: path.join(__dirname, 'dist'),
hot: true,
host: '0.0.0.0',
allowedHosts: ['localhost', '.gitpod.io'],
},
mode: 'development',
plugins: [
...(common.plugins || []),
...HTMLPlugins({ injectTrackingScript: true }),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development'),
'process.env.BRANCH': JSON.stringify(process.env.BRANCH),
'process.env.SERVER_URL': JSON.stringify(process.env.SERVER_URL),
'process.env.CONTEXT': JSON.stringify(process.env.CONTEXT),
'process.env.SENTRY_DSN': JSON.stringify(process.env.SENTRY_DSN),
'process.env.ENCRYPTION_KEY': JSON.stringify(process.env.ENCRYPTION_KEY),
}),
new ReactRefreshWebpackPlugin(),
/*
* See eslintrc.required.js for why this is commented
new ESLintPlugin({
overrideConfigFile: path.resolve(__dirname, '.eslintrc.required.js'),
}),
*/
],
}