-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathvite.config.ts
More file actions
39 lines (36 loc) · 1.49 KB
/
vite.config.ts
File metadata and controls
39 lines (36 loc) · 1.49 KB
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
39
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// eslint-disable-next-line no-restricted-imports
import * as path from 'path';
import { loadEnv } from 'vite';
import topLevelAwait from 'vite-plugin-top-level-await';
import wasm from 'vite-plugin-wasm';
import { defineConfig } from 'vitest/config';
const exclude = [
/* repo specific: */ '**/.simulation/**', '**/.venv/**', '**/fixtures/**', 'chat-lib/**',
/* default: */ '**/node_modules/**', '**/dist/**', '**/cypress/**', '**/.{idea,git,cache,output,temp}/**', '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*',
];
// reference https://vitest.dev/config/#configuring-vitest
export default defineConfig(({ mode }) => ({
test: {
include: ['**/*.spec.ts', '**/*.spec.tsx'],
exclude,
env: loadEnv(mode, process.cwd(), ''),
alias: {
// similar to aliasing in the esbuild config `.esbuild.ts`
// vitest requires aliases to be absolute paths. reference: https://vitejs.dev/config/shared-options#resolve-alias
'vscode': path.resolve(__dirname, 'src/util/common/test/shims/vscodeTypesShim.ts'),
}
},
server: {
watch: {
ignored: exclude,
}
},
plugins: [
wasm(),
topLevelAwait()
]
}));