index.ts 823 B

12345678910111213141516171819202122
  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 path from 'path';
  10. export default (viteEnv: any, isBuild = false): [] => {
  11. const vitePlusgins: any = [];
  12. vitePlusgins.push(vue());
  13. vitePlusgins.push(createUnoCss());
  14. vitePlusgins.push(createAutoImport(path));
  15. vitePlusgins.push(createComponents(path));
  16. vitePlusgins.push(createCompression(viteEnv));
  17. vitePlusgins.push(createIcons());
  18. vitePlusgins.push(createSvgIconsPlugin(path, isBuild));
  19. vitePlusgins.push(createSetupExtend());
  20. return vitePlusgins;
  21. };