import { mergeConfig } from 'vite'
import baseConfig from './vite.config.base'
import configCompressPlugin from './plugin/compress'
import configVisualizerPlugin from './plugin/visualizer'
// import configStyleImportPlugin from './plugin/styleImport'
import configImageminPlugin from './plugin/imagemin'

export default mergeConfig(
  {
    mode: 'production',
    plugins: [
      configCompressPlugin('gzip'),
      configVisualizerPlugin(),
      // configStyleImportPlugin(),
      configImageminPlugin()
    ],
    build: {
      rollupOptions: {
        output: {
          manualChunks: {
            arco: ['@arco-design/web-vue'],
            chart: ['echarts', 'vue-echarts'],
            vue: ['vue', 'pinia', '@vueuse/core']
          }
        }
      },
      chunkSizeWarningLimit: 2000
    }
  },
  baseConfig
)
