mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-29 19:59:19 +01:00
3b795b1e58
* Extract chat lib * Extract chat lib * Add test * Get test working * Simulate response * Fix type issue * Package * Cleanup * Tuck away workspace service * Include package.json * Ensure shim is used * Include tiktoken files in package * Update @vscode/copilot-api * Ignore chat-lib
40 lines
1.5 KiB
TypeScript
40 lines
1.5 KiB
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* 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()
|
|
]
|
|
}));
|