index.js 543 B

123456789101112131415
  1. import vue from '@vitejs/plugin-vue'
  2. import createAutoImport from './auto-import'
  3. import createSvgIcon from './svg-icon'
  4. import createCompression from './compression'
  5. import createSetupExtend from './setup-extend'
  6. export default function createVitePlugins(viteEnv, isBuild = false) {
  7. const vitePlugins = [vue()]
  8. vitePlugins.push(createAutoImport())
  9. vitePlugins.push(createSetupExtend())
  10. vitePlugins.push(createSvgIcon(isBuild))
  11. isBuild && vitePlugins.push(...createCompression(viteEnv))
  12. return vitePlugins
  13. }