Skip to content

Instantly share code, notes, and snippets.

@irvinebroque
Created November 26, 2014 19:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save irvinebroque/13ccc9816ab9e18bbc1e to your computer and use it in GitHub Desktop.
Save irvinebroque/13ccc9816ab9e18bbc1e to your computer and use it in GitHub Desktop.
Simple webpackDevServer
// This little dev server is basically a wrapped express server that 'hot loads' our javascript for super fancy and fast live reload in development
var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
var config = require('./webpack.config');
var port = process.env.HOT_LOAD_PORT || 3001;
new WebpackDevServer(webpack(config), {
publicPath: 'http://localhost:3001/build/',
hot: true
}).listen(port, 'localhost', function (err, result) {
if (err) {
console.log(err);
}
console.log('Listening at localhost:' + port);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment