Created
May 23, 2017 07:48
-
-
Save timonweb/7c1184979c150756ebd1bba8abe2aa13 to your computer and use it in GitHub Desktop.
A basic ES2015 Webpack Configuration with Uglification
This file contains hidden or 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
var debug = process.env.NODE_ENV !== "production"; | |
var webpack = require('webpack'); | |
module.exports = { | |
entry: './src/main.js', | |
output: { | |
path: './dist/', | |
filename: 'bundle.js' | |
}, | |
module: { | |
loaders: [ | |
{ | |
loader: 'babel-loader', | |
test: /\.js/, | |
query: { | |
presets: 'es2015', | |
}, | |
} | |
] | |
}, | |
plugins: debug ? [] : [ | |
new webpack.optimize.DedupePlugin(), | |
new webpack.optimize.OccurenceOrderPlugin(), | |
new webpack.optimize.UglifyJsPlugin({ mangle: false, sourcemap: false }), | |
], | |
// Create Sourcemaps for the bundle | |
devtool: 'source-map', | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment