-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdev-bundler.js
43 lines (37 loc) · 998 Bytes
/
dev-bundler.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
/*eslint-disable no-var*/
'use strict';
var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
var config = require('./conf/webpack.config.js');
module.exports = function() {
var bundleStart = null;
var compiler = webpack(config);
compiler.plugin('compile', function() {
console.log('Bundling...');
bundleStart = Date.now();
});
compiler.plugin('done', function() {
console.log('Bundled in ' + (Date.now() - bundleStart) + 'ms!');
});
var bundler = new WebpackDevServer(compiler, {
historyApiFallback: true,
hot: true,
inline: true,
publicPath: config.output.publicPath,
quiet: false,
noInfo: false,
stats: {
assets: false,
chunkModules: false,
chunks: true,
colors: true,
hash: false,
progress: false,
timings: false,
version: false
}
});
bundler.listen(8080, 'localhost', function() {
console.log('Bundling project, please wait...');
});
};