vite.config.prod.ts 828 B

12345678910111213141516171819202122232425262728293031
  1. import { mergeConfig } from 'vite'
  2. import baseConfig from './vite.config.base'
  3. import configCompressPlugin from './plugin/compress'
  4. import configVisualizerPlugin from './plugin/visualizer'
  5. // import configStyleImportPlugin from './plugin/styleImport'
  6. import configImageminPlugin from './plugin/imagemin'
  7. export default mergeConfig(
  8. {
  9. mode: 'production',
  10. plugins: [
  11. configCompressPlugin('gzip'),
  12. configVisualizerPlugin(),
  13. // configStyleImportPlugin(),
  14. configImageminPlugin()
  15. ],
  16. build: {
  17. rollupOptions: {
  18. output: {
  19. manualChunks: {
  20. arco: ['@arco-design/web-vue'],
  21. chart: ['echarts', 'vue-echarts'],
  22. vue: ['vue', 'pinia', '@vueuse/core']
  23. }
  24. }
  25. },
  26. chunkSizeWarningLimit: 2000
  27. }
  28. },
  29. baseConfig
  30. )