index.ts 766 B

12345678910111213141516171819202122232425262728
  1. import type { PluginOption } from 'vite';
  2. import vue from '@vitejs/plugin-vue';
  3. import vueJsx from '@vitejs/plugin-vue-jsx';
  4. import VueDevtools from 'vite-plugin-vue-devtools';
  5. import progress from 'vite-plugin-progress';
  6. import { setupElegantRouter } from './router';
  7. import { setupUnocss } from './unocss';
  8. import { setupUnplugin } from './unplugin';
  9. import { setupHtmlPlugin } from './html';
  10. export function setupVitePlugins(viteEnv: Env.ImportMeta, buildTime: string) {
  11. const plugins: PluginOption = [
  12. vue({
  13. script: {
  14. defineModel: true
  15. }
  16. }),
  17. vueJsx(),
  18. VueDevtools(),
  19. setupElegantRouter(),
  20. setupUnocss(viteEnv),
  21. ...setupUnplugin(viteEnv),
  22. progress(),
  23. setupHtmlPlugin(buildTime)
  24. ];
  25. return plugins;
  26. }