Skip to content

Instantly share code, notes, and snippets.

@vsnikkil
Created September 11, 2016 18:34
Show Gist options
  • Save vsnikkil/71b5b68124a7db56526c00105a72f7b8 to your computer and use it in GitHub Desktop.
Save vsnikkil/71b5b68124a7db56526c00105a72f7b8 to your computer and use it in GitHub Desktop.
webpack.conf.js example
const webpack = require('webpack')
module.exports = {
devtool: process.env.NODE_ENV === 'production' ? 'cheap-module-source-map' : 'eval',
module: {
loaders: [
{
test: /\.js?$/,
exclude: /node_modules/,
loader: 'babel',
query: {
"presets": [
"es2015",
"react",
"stage-0"
]
}
}
]
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development')
}
})
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment