Skip to content

Instantly share code, notes, and snippets.

@xuyuji9000
Created April 28, 2017 15:06
Show Gist options
  • Save xuyuji9000/46b55b077a3671a71789af2d2f27b854 to your computer and use it in GitHub Desktop.
Save xuyuji9000/46b55b077a3671a71789af2d2f27b854 to your computer and use it in GitHub Desktop.
var webpack = require('webpack');
var path = require('path');
module.exports = {
context: __dirname,
devtool: "inline-sourcemap" ,
entry: [
"./src/app.js",
"webpack-dev-server/client?http://localhost:8080",
"webpack/hot/dev-server"
],
output: {
path: __dirname + "/dist",
filename: "bundle.js",
publicPath: "/dist/"
},
plugins: [
new webpack.HotModuleReplacementPlugin()
],
module: {
loaders: [
{
test: /.jsx?$/,
exclude: /node_modules/,
loaders: ['react-hot-loader/webpack', 'babel-loader?'+JSON.stringify({
presets: ['es2015', 'react', 'stage-2', "stage-1"],
plugins: ["transform-decorators-legacy", "transform-class-properties"]
})],
include: path.join(__dirname, 'src')
},
{
test: /\.css$/,
loader: 'style!css?modules',
include: /flexboxgrid/
}
]
},
node: {
fs: "empty"
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment