-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathwebpack.dev.js
50 lines (47 loc) · 1.16 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
46
47
48
49
50
const helpers = require('./helpers');
const webpackMerge = require('webpack-merge');
const commonConfig = require('./webpack.common.js');
const DefinePlugin = require('webpack/lib/DefinePlugin');
const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin');
const ENV = process.env.ENV = process.env.NODE_ENV = 'development';
module.exports = webpackMerge(commonConfig, {
devtool: 'cheap-module-source-map',
output: {
path: helpers.root('dist'),
filename: '[name].js',
sourceMapFilename: '[name].map',
chunkFilename: '[id].chunk.js',
// required for hot module replacement
publicPath: 'http://localhost:4200/',
},
plugins: [
new DefinePlugin({
'ENV': JSON.stringify(ENV),
}),
new LoaderOptionsPlugin({
debug: true,
}),
],
devServer: {
port: 4200,
host: 'localhost',
historyApiFallback: true,
watchOptions: {
aggregateTimeout: 300,
poll: 1000
},
proxy: {
'/api': {
target: 'http://localhost:8080',
}
},
},
node: {
global: true,
crypto: 'empty',
process: true,
module: false,
clearImmediate: false,
setImmediate: false
}
});