Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. /* eslint-disable*/
  2. const merge = require('webpack-merge');
  3. const baseConfig = require('./base.config');
  4. const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
  5. const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
  6. const WebpackVisualizer = require('webpack-visualizer-plugin');
  7. const MiniCssExtractPlugin = require('mini-css-extract-plugin');
  8.  
  9. const productionConfig = env => {
  10. return merge([
  11. {
  12. optimization: {
  13. minimizer: [new UglifyJsPlugin()],
  14. },
  15. plugins: [
  16. new MiniCssExtractPlugin(),
  17. new OptimizeCssAssetsPlugin(),
  18. new WebpackVisualizer({ filename: './statistics_visual.html' }),
  19. ],
  20. },
  21. ]);
  22. };
  23.  
  24. module.exports = env => {
  25. return merge(baseConfig(env), productionConfig(env));
  26. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement