index.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import type { PluginOption } from 'vite';
  2. import vue from '@vitejs/plugin-vue';
  3. import vueJsx from '@vitejs/plugin-vue-jsx';
  4. import appInfo from './app-info';
  5. import createAutoImport from './auto-import';
  6. import createComponents from './components';
  7. import createDevtools from './dev-tools';
  8. import createHtml from './html';
  9. import createUnocss from './unocss';
  10. import createSetupExtend from './setup-extend';
  11. import createLayouts from './layouts';
  12. import createPage from './pages';
  13. import createCompression from './compression';
  14. import createQiankun from './qiankun';
  15. import createBanner from './banner';
  16. import createCodeInspectorPlugin from './codeInspectorPlugin.ts';
  17. export default function createVitePlugins() {
  18. const vitePlugins: (PluginOption | PluginOption[])[] = [appInfo(), vue(), vueJsx()];
  19. vitePlugins.push(createAutoImport());
  20. vitePlugins.push(createComponents());
  21. vitePlugins.push(createDevtools());
  22. vitePlugins.push(createHtml());
  23. vitePlugins.push(createUnocss());
  24. vitePlugins.push(createSetupExtend());
  25. vitePlugins.push(createLayouts());
  26. vitePlugins.push(createPage());
  27. vitePlugins.push(createCompression());
  28. vitePlugins.push(createQiankun());
  29. vitePlugins.push(createBanner());
  30. vitePlugins.push(createCodeInspectorPlugin());
  31. return vitePlugins;
  32. }