2025-02-26 12:01:53 +00:00
|
|
|
import { configDefaults } from 'vitest/config'
|
|
|
|
|
import { defineConfig } from 'vitest/config';
|
|
|
|
|
import vue from '@vitejs/plugin-vue'
|
|
|
|
|
import vueJsx from '@vitejs/plugin-vue-jsx'
|
|
|
|
|
|
|
|
|
|
import { fileURLToPath, URL } from 'node:url'
|
|
|
|
|
|
|
|
|
|
import AutoImport from 'unplugin-auto-import/vite'
|
|
|
|
|
import Components from 'unplugin-vue-components/vite'
|
|
|
|
|
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
|
|
|
|
|
import { nodePolyfills } from 'vite-plugin-node-polyfills'
|
|
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
plugins: [
|
|
|
|
|
vue(), vueJsx(),
|
|
|
|
|
AutoImport({
|
|
|
|
|
resolvers: [ElementPlusResolver()],
|
|
|
|
|
}),
|
|
|
|
|
Components({
|
|
|
|
|
resolvers: [ElementPlusResolver()],
|
|
|
|
|
}),
|
|
|
|
|
nodePolyfills({
|
|
|
|
|
protocolImports: true,
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
resolve: {
|
|
|
|
|
alias: {
|
|
|
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
test: {
|
|
|
|
|
globals: true,
|
|
|
|
|
environment: 'happy-dom', // Simulates a browser environment
|
|
|
|
|
exclude:[
|
|
|
|
|
...configDefaults.exclude,
|
2025-03-26 19:03:26 +00:00
|
|
|
'**/integration/*'
|
2025-02-28 13:36:42 +00:00
|
|
|
],
|
|
|
|
|
pool: "vmThreads",
|
|
|
|
|
deps: {
|
|
|
|
|
inline: ['element-plus'],
|
|
|
|
|
}
|
2025-02-26 12:01:53 +00:00
|
|
|
},
|
|
|
|
|
});
|