Skip to content

Instantly share code, notes, and snippets.

@sortofsleepy
Created January 24, 2017 18:42
Show Gist options
  • Save sortofsleepy/cc18e2c013d4623cd3169b01bb1ede9e to your computer and use it in GitHub Desktop.
Save sortofsleepy/cc18e2c013d4623cd3169b01bb1ede9e to your computer and use it in GitHub Desktop.
Shows webpack 2 hot reload working (adjust as necessary)
// configuration. Pass in your the path to your own file or it defaults to a default one
config = {
entry: default_entries,
performance:{
hints:false
},
output:{
path:OUTPUT,
filename:"app.js",
publicPath:"/"
},
module:{
loaders:[
{
test:/\.js$/,
exclude:/node_modules/,
loaders:[
__dirname + '/node_modules/babel-loader'
]
}
]
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin()
]
}
/// SERVER
var server = new WebpackServer(compiler,{
hot:HOTLOAD,
noInfo:true,
contentBase:path.resolve(`${__dirname}/../`,DIST),
publicPath:"/",
stats:{
errors:true,
hash:false,
version:false,
assets:false,
timings:false,
chunks:false
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment