-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.dev.js
30 lines (27 loc) · 1.09 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
const Webpack = require('webpack');
const webpackMerge = require('webpack-merge');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const commonConfig = require('./webpack.common');
console.log(`the current process.env.CONTEXT environment variable is ${ process.env.CONTEXT}`);
module.exports = webpackMerge.merge(commonConfig, {
mode: 'development',
devtool: 'cheap-module-source-map',
devServer: {
hot: true,
host: 'localhost',
port: 8080,
inline: true,
stats: { 'errors-only': true, 'colors': true },
historyApiFallback: true,
allowedHosts: JSON.parse(process.env.ALLOWED_HOSTS || '["localhost"]'),
headers: { 'Access-Control-Allow-Origin': '*' },
publicPath: process.env.CONTEXT || '/'
},
plugins: [
new BundleAnalyzerPlugin({ openAnalyzer: false, analyzerPort: 5050 }),
new Webpack.DefinePlugin({
'process.env.NODE_ENV': '"development"',
'process.env.GEOSTREAMS_URL': JSON.stringify(process.env.GEOSTREAMS_URL || 'http://localhost:9000')
})
]
});