crm-yx/vite.config.ts
zzs01@yunemao.com cbb14e0916
Some checks failed
Test / build (lts/*, ubuntu-latest) (push) Has been cancelled
Test / build (lts/*, windows-latest) (push) Has been cancelled
config
2024-09-12 16:45:22 +08:00

64 lines
1.4 KiB
TypeScript

/// <reference types="vitest" />
import path from 'node:path'
import Vue from '@vitejs/plugin-vue'
import UnoCSS from 'unocss/vite'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import VueMacros from 'unplugin-vue-macros/vite'
import { VueRouterAutoImports } from 'unplugin-vue-router'
import VueRouter from 'unplugin-vue-router/vite'
import { defineConfig } from 'vite'
export default defineConfig({
resolve: {
alias: {
'~/': `${path.resolve(__dirname, 'src')}/`,
},
},
plugins: [
VueMacros({
defineOptions: false,
defineModels: false,
plugins: {
vue: Vue({
script: {
propsDestructure: true,
defineModel: true,
},
}),
},
}),
// https://github.com/posva/unplugin-vue-router
VueRouter(),
// https://github.com/antfu/unplugin-auto-import
AutoImport({
imports: [
'vue',
'@vueuse/core',
VueRouterAutoImports,
{
// add any other imports you were relying on
'vue-router/auto': ['useLink'],
},
],
dts: true,
dirs: [
'./src/composables',
],
vueTemplate: true,
}),
// https://github.com/antfu/vite-plugin-components
Components({
dts: true,
}),
// https://github.com/antfu/unocss
// see uno.config.ts for config
UnoCSS(),
],
})