forked from kozlice/angular2-webpack-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.dev.js
47 lines (40 loc) · 1.04 KB
/
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
41
42
43
44
45
46
47
'use strict';
/**
* TODO: Comments
*/
const webpack = require('webpack');
const ENV = process.env.ENV = process.env.NODE_ENV = 'dev';
let config = require('./webpack.config.common');
config.devtool = 'inline-source-map';
config.output = {
path: './dist',
publicPath: 'http://localhost:9045/',
filename: '[name].js',
chunkFilename: '[id].chunk.js',
sourceMapFilename: '[name].map'
};
config.debug = true;
config.devServer = {
historyApiFallback: true,
stats: 'minimal',
outputPath: 'dist',
host: 'localhost',
port: 9045,
watchOptions: {
aggregateTimeout: 300,
poll: 1000
}
};
/**
* Quote from webpack docs: "Define free variables. Useful for having development builds with debug logging
* or adding global constants."
*
* Note, that values are _evaluated_, not just assigned (this is why we use `JSON.stringify` here).
*/
config.plugins.push(new webpack.DefinePlugin({
'ENV': JSON.stringify(ENV),
'process.env': {
'ENV': JSON.stringify(ENV)
}
}));
module.exports = config;