-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathvitest.config.mts
38 lines (36 loc) · 1.3 KB
/
vitest.config.mts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { fileURLToPath } from 'url';
import tsconfigPaths from 'vite-tsconfig-paths';
import { defineConfig } from 'vitest/config';
import pkg from './package.json';
// https://vitejs.dev/config/
export default defineConfig({
esbuild: {
define: { global: 'window' },
target: ['chrome132', 'node20.18.1'],
},
plugins: [tsconfigPaths()],
resolve: {
alias: {
app: fileURLToPath(new URL('.', import.meta.url)),
assets: fileURLToPath(new URL('./src/assets', import.meta.url)),
boot: fileURLToPath(new URL('./src/boot', import.meta.url)),
components: fileURLToPath(new URL('./src/components', import.meta.url)),
layouts: fileURLToPath(new URL('./src/layouts', import.meta.url)),
main: fileURLToPath(new URL('./src-electron/main', import.meta.url)),
pages: fileURLToPath(new URL('./src/pages', import.meta.url)),
preload: fileURLToPath(
new URL('./src-electron/preload', import.meta.url),
),
src: fileURLToPath(new URL('./src', import.meta.url)),
'src-electron': fileURLToPath(new URL('./src-electron', import.meta.url)),
stores: fileURLToPath(new URL('./src/stores', import.meta.url)),
},
},
test: {
env: {
repository: pkg.repository.url.replace('.git', ''),
version: '1.2.3',
VITEST: 'true',
},
},
});