2
0

vitest.config.ts 854 B

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