Rift.IO OSM R1 Initial Submission
[osm/UI.git] / skyquake / plugins / helloworld / server / bundle.js
1
2 /*
3 * STANDARD_RIFT_IO_COPYRIGHT
4 */
5 var Webpack = require('webpack');
6 var WebpackDevServer = require('webpack-dev-server');
7 var webpackConfig = require('./../webpack.config.js');
8 var path = require('path');
9 var fs = require('fs');
10 var mainPath = path.resolve(__dirname, '..', 'app', 'main.js');
11
12 module.exports = function () {
13 var bundleStart = null;
14 var compiler = Webpack(webpackConfig);
15
16 compiler.plugin('compile', function() {
17 console.log('Bundling...');
18 bundleStart = Date.now();
19 });
20
21 compiler.plugin('done', function() {
22 console.log('Bundled in ' + (Date.now() - bundleStart) + 'ms!');
23 });
24
25 var bundler = new WebpackDevServer(compiler, {
26 contentBase: "http://localhost",
27 publicPath: '/build/',
28
29 hot: true,
30 progress: true,
31
32 quiet: true,
33 noInfo: false,
34 stats: {
35 colors: true
36 }
37 });
38 bundler.listen(8080, 'localhost', function () {
39 console.log('Bundling project, please wait...');
40 });
41
42 };