webpack.prod.config.js 555 B

123456789101112131415161718192021222324
  1. var UglifyJsPlugin = require('uglifyjs-webpack-plugin');
  2. var merge = require('webpack-merge');
  3. var common = require('./webpack.config');
  4. module.exports = merge(common, {
  5. mode: 'production',
  6. devtool: 'source-map',
  7. optimization: {
  8. minimizer: [
  9. new UglifyJsPlugin({
  10. parallel: true,
  11. sourceMap: true,
  12. uglifyOptions: {
  13. beautify: false,
  14. comments: false,
  15. compress: false,
  16. ecma: 6,
  17. mangle: true
  18. },
  19. cache: process.platform !== 'win32'
  20. })
  21. ]
  22. }
  23. });