vitest.config.ts 580 B

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