99 Star 1.4K Fork 554

GVPHuLaSpark/HuLa

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vitest.config.ts 1.73 KB
一键复制 编辑 原始数据 按行查看 历史
meow2149 提交于 2025-12-29 10:27 +08:00 . chore: normalize tooling configurations
/// <reference types="vitest" />
import { fileURLToPath, URL } from 'node:url'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import AutoImport from 'unplugin-auto-import/vite'
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
import Components from 'unplugin-vue-components/vite'
import { defineConfig } from 'vitest/config'
import { getComponentsDirs, getComponentsDtsPath } from './build/config/components'
const testPlatform = process.env.TAURI_ENV_PLATFORM
const testComponentsDirs = getComponentsDirs(testPlatform)
const testComponentsDtsPath = getComponentsDtsPath(testPlatform)
export default defineConfig({
plugins: [
vue(),
vueJsx(),
AutoImport({
imports: [
'vue',
'vue-router',
'pinia',
{ 'naive-ui': ['useDialog', 'useMessage', 'useNotification', 'useLoadingBar', 'useModal'] }
],
dts: 'src/typings/auto-imports.d.ts'
}),
/**自动导入组件,但是不会自动导入jsx和tsx*/
Components({
dirs: testComponentsDirs, // 根据环境加载对应组件目录
resolvers: [NaiveUiResolver()],
dts: testComponentsDtsPath
})
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
'#': fileURLToPath(new URL('./src/mobile', import.meta.url)),
'~': fileURLToPath(new URL('.', import.meta.url))
}
},
test: {
environment: 'happy-dom',
globals: true,
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
include: ['src/**/*.{vue,js,jsx,ts,tsx}'],
exclude: ['src/**/*.{test,spec}.{js,ts}', 'src/types/**', 'src/**/*.d.ts']
}
}
})
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Rust
1
https://gitee.com/HuLaSpark/HuLa.git
git@gitee.com:HuLaSpark/HuLa.git
HuLaSpark
HuLa
HuLa
master

搜索帮助