index.ts 884 B

123456789101112131415161718192021222324
  1. import vue from '@vitejs/plugin-vue';
  2. import createUnoCss from './unocss';
  3. import createAutoImport from './auto-import';
  4. import createComponents from './components';
  5. import createIcons from './icons';
  6. import createSvgIconsPlugin from './svg-icon';
  7. import createCompression from './compression';
  8. import createSetupExtend from './setup-extend';
  9. import createI18n from './i18n';
  10. import path from 'path';
  11. export default (viteEnv: any, isBuild = false): [] => {
  12. const vitePlugins: any = [];
  13. vitePlugins.push(vue());
  14. vitePlugins.push(createUnoCss());
  15. vitePlugins.push(createAutoImport(path));
  16. vitePlugins.push(createComponents(path));
  17. vitePlugins.push(createCompression(viteEnv));
  18. vitePlugins.push(createIcons());
  19. vitePlugins.push(createSvgIconsPlugin(path, isBuild));
  20. vitePlugins.push(createSetupExtend());
  21. vitePlugins.push(createI18n(path));
  22. return vitePlugins;
  23. };