Skip to content

Instantly share code, notes, and snippets.

@dengjonathan
Created October 5, 2016 01:57
Show Gist options
  • Save dengjonathan/07cd942cac93950b735925e4b1bd8a31 to your computer and use it in GitHub Desktop.
Save dengjonathan/07cd942cac93950b735925e4b1bd8a31 to your computer and use it in GitHub Desktop.
Webpack Production Config with ES6/ React
const path = require('path');
const webpack = require('webpack');
module.exports = {
devtool: 'source-map',
entry: [
'./app/index.js'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/dist/'
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
minimize: true,
compress: {
warnings: false
}
})
],
module: {
loaders: [{
test: /.jsx?$/,
loader: 'babel-loader',
include: path.join(__dirname, 'app'),
exclude: /node_modules/,
query: {
presets: ['es2015', 'react']
}
}]
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment