Created
October 5, 2016 01:57
-
-
Save dengjonathan/07cd942cac93950b735925e4b1bd8a31 to your computer and use it in GitHub Desktop.
Webpack Production Config with ES6/ React
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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