vitest.config.ts 698 B

1234567891011121314151617181920212223242526
  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. '**/__mocks__**',
  17. '**/node_modules/**',
  18. '**/dist/**',
  19. '**/lib/**', // lib 编译结果忽略掉
  20. '**/cypress/**',
  21. '**/.{idea,git,cache,output,temp}/**',
  22. '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*',
  23. ],
  24. },
  25. });