拓恒飞手平台网页
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 658B

2 years ago
1234567891011121314151617181920212223242526
  1. import vue from '@vitejs/plugin-vue'
  2. import Components from 'unplugin-vue-components/vite'
  3. import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
  4. import VueSetupExtend from 'vite-plugin-vue-setup-extend'
  5. import { unocss } from './unocss'
  6. import { configHtmlPlugin } from './html'
  7. import { configMockPlugin } from './mock'
  8. export function createVitePlugins(viteEnv, isBuild) {
  9. const plugins = [
  10. vue(),
  11. Components({
  12. resolvers: [NaiveUiResolver()]
  13. }),
  14. VueSetupExtend(),
  15. unocss(),
  16. configHtmlPlugin(viteEnv, isBuild)
  17. ]
  18. viteEnv?.VITE_APP_USE_MOCK && plugins.push(configMockPlugin(isBuild))
  19. return plugins
  20. }