Rift.IO OSM R1 Initial Submission
[osm/UI.git] / skyquake / plugins / goodbyeworld / server / bundle.js
diff --git a/skyquake/plugins/goodbyeworld/server/bundle.js b/skyquake/plugins/goodbyeworld/server/bundle.js
new file mode 100644 (file)
index 0000000..6996392
--- /dev/null
@@ -0,0 +1,42 @@
+
+/*
+ * STANDARD_RIFT_IO_COPYRIGHT
+ */
+var Webpack = require('webpack');
+var WebpackDevServer = require('webpack-dev-server');
+var webpackConfig = require('./../webpack.config.js');
+var path = require('path');
+var fs = require('fs');
+var mainPath = path.resolve(__dirname, '..', 'app', 'main.js');
+
+module.exports = function () {
+  var bundleStart = null;
+  var compiler = Webpack(webpackConfig);
+
+  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, {
+    contentBase: "http://localhost",
+    publicPath: '/build/',
+
+    hot: true,
+    progress: true,
+
+    quiet: true,
+    noInfo: false,
+    stats: {
+      colors: true
+    }
+  });
+  bundler.listen(8080, 'localhost', function () {
+    console.log('Bundling project, please wait...');
+  });
+
+};