Skip to content

Instantly share code, notes, and snippets.

@chuck0523
Created June 28, 2016 12:36
Show Gist options
  • Save chuck0523/c2884064ef9b27517cd53d8af29b190e to your computer and use it in GitHub Desktop.
Save chuck0523/c2884064ef9b27517cd53d8af29b190e to your computer and use it in GitHub Desktop.
const WebpackDevServer = require("webpack-dev-server")
const webpack = require('webpack')
const config = require('./webpack.config.js')
config.entry.client.push("webpack-dev-server/client?http://localhost:8080")
config.entry.client.push("webpack/hot/dev-server")
config.plugins.push(new webpack.HotModuleReplacementPlugin())
const compiler = webpack(config)
const server = new WebpackDevServer(compiler, {
publicPath: config.output.publicPath,
hot: true
})
server.listen(8080)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment