webpack.config.prod.js 804 B

12345678910111213141516171819202122232425262728293031
  1. const path = require('path')
  2. const webpack = require('webpack')
  3. const merge = require('webpack-merge')
  4. const base = require('./webpack.config')
  5. module.exports = merge(base, {
  6. // Enable a full source map.
  7. devtool: 'source-map',
  8. output: {
  9. // Override output path to minjs dir
  10. path: path.join(__dirname, '/public/minjs/es'),
  11. },
  12. plugins: [
  13. // Use UglifyJS to minimise output
  14. new webpack.optimize.UglifyJsPlugin({
  15. // Enable compression (options here are UglifyJS options)
  16. compress: {
  17. drop_console: true, // Remove console logs
  18. warnings: false // Silence Uglify warnings
  19. },
  20. output: {
  21. comments: false // Remove comments
  22. },
  23. // Prevent source map files from being stripped out of bundle
  24. sourceMap: true
  25. })
  26. ]
  27. })