部署开发环境 / deploy-dev (push) Successful in 3m0s
- 将 auto-imports.d.ts 和 components.d.ts 移至 src/types/import 目录 - 修改 tsconfig.app.json 配置以排除旧的类型定义文件路径 - 在 vite.config.ts 中更新类型定义文件输出路径配置 - 重新生成组件和自动导入的类型声明文件
36 lines
1008 B
TypeScript
36 lines
1008 B
TypeScript
import {fileURLToPath, URL} from 'node:url'
|
|
|
|
import {defineConfig} from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import vueDevTools from 'vite-plugin-vue-devtools'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
import AutoImport from 'unplugin-auto-import/vite'
|
|
import Components from 'unplugin-vue-components/vite'
|
|
import {ElementPlusResolver} from 'unplugin-vue-components/resolvers'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
vueDevTools(),
|
|
tailwindcss(),
|
|
AutoImport({
|
|
imports: [
|
|
'vue',
|
|
'vue-router',
|
|
],
|
|
resolvers: [ElementPlusResolver()],
|
|
dts: 'src/types/import/auto-imports.d.ts',
|
|
}),
|
|
Components({
|
|
resolvers: [ElementPlusResolver()],
|
|
dts: 'src/types/import/components.d.ts',
|
|
}),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
},
|
|
},
|
|
})
|