Skip to content

Instantly share code, notes, and snippets.

@waleedahmad
Created March 4, 2016 17:29
Show Gist options
  • Save waleedahmad/dca31954a0c228d92a86 to your computer and use it in GitHub Desktop.
Save waleedahmad/dca31954a0c228d92a86 to your computer and use it in GitHub Desktop.
Webpack config file for React and ES6
var webpack = require('webpack');
module.exports = {
context: __dirname + "/src",
entry: "./app.js",
output: {
filename: "app.js",
path: __dirname + "/build",
},
module: {
loaders: [
{
test: /\.(es6|js)$/,
exclude: /node_modules/,
loaders: ["babel-loader"],
}
],
},
resolve : {
extensions : ['', '.js', '.es6']
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
}),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
})
],
watch : true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment