-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathwebpack.dev.config.js
42 lines (36 loc) · 1.08 KB
/
webpack.dev.config.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
/* global module, __dirname */
const path = require('path');
const webpack = require('webpack');
const config = require('./webpack.config');
config.mode = 'development';
config.devtool = 'inline-source-map';
config.performance.hints = false;
config.plugins = config.plugins.concat([
new webpack.DefinePlugin({
DEVELOPMENT: JSON.stringify(true),
PRODUCTION: JSON.stringify(false),
'process.env': {
'NODE_ENV': JSON.stringify('development')
}
}),
// Adds webpack HMR support. It act's like livereload,
// reloading page after webpack rebuilt modules.
// It also updates stylesheets and inline assets without page reloading.
new webpack.HotModuleReplacementPlugin()
]);
config.devServer = {
hot: true, // this enables hot reload
inline: true, // use inline method for hmr
host: 'localhost',
port: 8080,
contentBase: path.join(__dirname, 'public'),
compress: true,
stats: { colors: true },
proxy: {
'/api/**': {
target: 'http://localhost:9000',
logLevel: 'debug'
}
}
};
module.exports = config;