forked from OpenTreeMap/otm-core
-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.dev.config.js
45 lines (34 loc) · 974 Bytes
/
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
43
44
45
"use strict";
var webpack = require('webpack'),
config = require('./webpack.common.config.js'),
host = process.env.WEBPACK_DEV_SERVER || 'http://localhost:6062/';
// Add webpack-dev-server to the common entry bundle
config.entry['js/treemap/base'] = [
'webpack-dev-server/client?' + host,
'webpack/hot/dev-server',
'./opentreemap/treemap/js/src/base.js'
];
config.output.publicPath = host + 'static/';
config.output.pathInfo = true;
config.debug = true;
config.devtool = 'eval';
config.plugins = config.plugins.concat([
new webpack.HotModuleReplacementPlugin()
]);
// Allows require-ing the global variable created by django-js-reverse
config.externals = {
reverse: "Urls"
};
config.watchOptions = {
poll: 1000,
};
// Proxy all requests for static assets to nginx
config.devServer = {
proxy: {
'/static/*': {
target: 'http://localhost',
secure: false
}
}
};
module.exports = config;