Last active
March 20, 2017 08:15
-
-
Save xuyuji9000/7a8422b50a39d976f4e9797a51e3288d to your computer and use it in GitHub Desktop.
react webpack with hotload
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = require("path"); | |
var webpack = require("webpack"); | |
module.exports = { | |
entry: [ | |
'webpack-dev-server/client?http://0.0.0.0:8080', // WebpackDevServer host and port | |
'webpack/hot/only-dev-server', // "only" prevents reload on syntax errors | |
"./src/app.js" // appʼs entry point | |
], | |
devtool: "source-map", | |
output: { | |
path: __dirname + "/dist", | |
filename: "bundle.js", | |
publicPath: "/assets/" | |
}, | |
plugins: [ | |
new webpack.HotModuleReplacementPlugin() | |
], | |
module: { | |
loaders: [{ | |
test: /.jsx?$/, | |
exclude: /node_modules/, | |
loaders: ['react-hot-loader', 'babel-loader?'+JSON.stringify({ | |
presets: ['es2015', 'react'] | |
})] | |
}] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a react dev webpack configuration.