Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/copilot/vite.config.ts
13379 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import * as path from 'path';
7
import { loadEnv } from 'vite';
8
import topLevelAwait from 'vite-plugin-top-level-await';
9
import wasm from 'vite-plugin-wasm';
10
import { defineConfig } from 'vitest/config';
11
12
const exclude = [
13
/* repo specific: */ '**/.simulation/**', '**/.venv/**', '**/fixtures/**', 'chat-lib/**',
14
/* 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.*',
15
];
16
17
// reference https://vitest.dev/config/#configuring-vitest
18
export default defineConfig(({ mode }) => ({
19
test: {
20
include: ['**/*.spec.ts', '**/*.spec.tsx'],
21
exclude,
22
env: loadEnv(mode, process.cwd(), ''),
23
alias: {
24
// similar to aliasing in the esbuild config `.esbuild.mts`
25
// vitest requires aliases to be absolute paths. reference: https://vitejs.dev/config/shared-options#resolve-alias
26
'vscode': path.resolve(__dirname, 'src/util/common/test/shims/vscodeTypesShim.ts'),
27
}
28
},
29
server: {
30
watch: {
31
ignored: exclude,
32
}
33
},
34
plugins: [
35
wasm(),
36
topLevelAwait()
37
]
38
}));
39
40