vitest.config.ts 794 B

12345678910111213141516171819202122232425262728
  1. import vue from '@vitejs/plugin-vue'
  2. import { dirname, resolve } from 'node:path'
  3. import { fileURLToPath } from 'node:url'
  4. import { defineConfig } from 'vitest/config'
  5. const dir = dirname(fileURLToPath(import.meta.url))
  6. export default defineConfig({
  7. plugins: [vue()],
  8. resolve: {
  9. alias: [
  10. { find: '@siteData', replacement: resolve(dir, './shims.ts') },
  11. { find: 'client', replacement: resolve(dir, '../../src/client') },
  12. { find: 'node', replacement: resolve(dir, '../../src/node') },
  13. {
  14. find: /^vitepress$/,
  15. replacement: resolve(dir, '../../src/client/index.js')
  16. },
  17. {
  18. find: /^vitepress\/theme$/,
  19. replacement: resolve(dir, '../../src/client/theme-default/index.js')
  20. }
  21. ]
  22. },
  23. test: {
  24. globals: true
  25. }
  26. })