Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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