vitest.config.ts 674 B

12345678910111213141516171819202122232425
  1. const path = require('path');
  2. import { defineConfig } from 'vitest/config';
  3. export default defineConfig({
  4. build: {
  5. commonjsOptions: {
  6. transformMixedEsModules: true,
  7. },
  8. },
  9. test: {
  10. globals: true,
  11. mockReset: false,
  12. environment: 'jsdom',
  13. setupFiles: [path.resolve(__dirname, './vitest.setup.ts')],
  14. include: ['**/?(*.){test,spec}.?(c|m)[jt]s?(x)'],
  15. exclude: [
  16. '**/node_modules/**',
  17. '**/dist/**',
  18. '**/lib/**', // lib 编译结果忽略掉
  19. '**/cypress/**',
  20. '**/.{idea,git,cache,output,temp}/**',
  21. '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*',
  22. ],
  23. },
  24. });