Simplify the source code

This commit is contained in:
Lyubo Marinov 2017-06-16 12:00:28 -05:00
parent 1da49d86a1
commit 5cffe328a5
1 changed files with 2 additions and 13 deletions

View File

@ -34,21 +34,15 @@ if (minimize) {
} }
})); }));
// While webpack will automatically insert UglifyJsPlugin when minimize is
// true, the defaults of UglifyJsPlugin in webpack 1 and webpack 2 are
// different. Explicitly state what we want even if we want defaults in
// order to prepare for webpack 2.
plugins.push(new webpack.optimize.UglifyJsPlugin({ plugins.push(new webpack.optimize.UglifyJsPlugin({
compress: { compress: {
// It is nice to see warnings from UglifyJsPlugin that something is // It is nice to see warnings from UglifyJsPlugin that something is
// unused and, consequently, is removed. The default is false in // unused/removed.
// webpack 2.
warnings: true warnings: true
}, },
extractComments: true, extractComments: true,
// Use the source map to map error message locations to modules. The // Use the source map to map error message locations to modules.
// default is false in webpack 2.
sourceMap: true sourceMap: true
})); }));
} }
@ -160,11 +154,6 @@ const config = {
'browser' 'browser'
], ],
extensions: [ extensions: [
// Webpack 2 broke haste-resolver-webpack-plugin and I could not fix
// it. But given that there is resolve.extensions and the only
// non-default extension we have is .web.js, drop
// haste-resolver-webpack-plugin and go with resolve.extensions.
'.web.js', '.web.js',
// Webpack defaults: // Webpack defaults: