Skip to content

Instantly share code, notes, and snippets.

@timonweb
Created May 23, 2017 07:48
Show Gist options
  • Save timonweb/7c1184979c150756ebd1bba8abe2aa13 to your computer and use it in GitHub Desktop.
Save timonweb/7c1184979c150756ebd1bba8abe2aa13 to your computer and use it in GitHub Desktop.
A basic ES2015 Webpack Configuration with Uglification
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