webpack.config.prod.js 824 B

1234567891011121314151617181920212223242526
  1. const { merge } = require('webpack-merge');
  2. const common = require('./webpack.common.js');
  3. const HtmlWebpackPlugin = require('html-webpack-plugin');
  4. const CopyPlugin = require('copy-webpack-plugin');
  5. module.exports = merge(common, {
  6. mode: 'production',
  7. plugins: [
  8. new HtmlWebpackPlugin({
  9. template: './index.html',
  10. }),
  11. new CopyPlugin({
  12. patterns: [
  13. { from: 'img', to: 'img' },
  14. { from: 'css', to: 'css' },
  15. { from: 'js/vendor', to: 'js/vendor' },
  16. { from: 'icon.svg', to: 'icon.svg' },
  17. { from: 'favicon.ico', to: 'favicon.ico' },
  18. { from: 'robots.txt', to: 'robots.txt' },
  19. { from: 'icon.png', to: 'icon.png' },
  20. { from: '404.html', to: '404.html' },
  21. { from: 'site.webmanifest', to: 'site.webmanifest' },
  22. ],
  23. }),
  24. ],
  25. });