Skip to content

Instantly share code, notes, and snippets.

@BlakeWilliams
Created June 29, 2015 00:34
Show Gist options
  • Select an option

  • Save BlakeWilliams/2bbd5586b4256d94392a to your computer and use it in GitHub Desktop.

Select an option

Save BlakeWilliams/2bbd5586b4256d94392a to your computer and use it in GitHub Desktop.
var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
var config = require('./webpack.config');
var port = 8000;
config.entry.unshift("webpack-dev-server/client?http://localhost:" + port);
config.entry.unshift("webpack/hot/dev-server");
config.plugins.push(
new webpack.HotModuleReplacementPlugin()
);
new WebpackDevServer(webpack(config), {
contentBase: "./public",
hot: true,
historyApiFallback: true,
noInfo: true,
}).listen(port, 'localhost', function (err, result) {
console.log('Listening at localhost:' + port);
if (err) {
console.log(err);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment