-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.dev.js
More file actions
29 lines (25 loc) · 925 Bytes
/
webpack.config.dev.js
File metadata and controls
29 lines (25 loc) · 925 Bytes
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
var base = require('./webpack.config.base');
var webpack = require('webpack');
var OpenBrowserPlugin = require('open-browser-webpack-plugin');
var validate = require('webpack-validator');
var Joi = validate.Joi;
var dev = base;
dev.devServerPort = 3000;
dev.devtool = 'cheap-eval-source-map';
dev.entry.main = [
'webpack-dev-server/client?http://localhost:' + dev.devServerPort,
'webpack/hot/dev-server',
]
.concat(dev.entry.main);
// Tell django to use this URL to load packages and not use STATIC_URL + bundle_name
dev.output.publicPath = 'http://localhost:' + dev.devServerPort + '/dist/';
dev.plugins = dev.plugins.concat([
new webpack.HotModuleReplacementPlugin(),
new OpenBrowserPlugin({
url: 'http://localhost:' + dev.devServerPort + '/dist/',
browser: 'Google Chrome'
}),
]);
module.exports = validate(dev, {
schemaExtension: Joi.object({devServerPort: Joi.any()})
});