Skip to content

Instantly share code, notes, and snippets.

@velocity-360
Last active February 16, 2019 01:12
Show Gist options
  • Save velocity-360/01ac2e04548bf06c109abfbba6d28f2f to your computer and use it in GitHub Desktop.
Save velocity-360/01ac2e04548bf06c109abfbba6d28f2f to your computer and use it in GitHub Desktop.
const webpack = require('webpack')
const path = require('path')
module.exports = {
entry: {
app: './src/index.js'
},
output: {
path: __dirname+'/public/dist',
filename: 'bundle/[name].js',
sourceMapFilename: 'bundle/[name].map'
},
node: {
fs: 'empty'
},
devtool: '#source-map',
performance: process.env.NODE_ENV === 'production' ? {hints: false} : {},
plugins: process.env.NODE_ENV === 'production' ? [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
})
] : [],
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader',
query:{
presets:['react', 'env']
}
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment