vitest.config.ts 680 B

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