mirror of
https://github.com/teableio/teable.git
synced 2026-02-19 17:19:50 +08:00
41 lines
1.0 KiB
TypeScript
41 lines
1.0 KiB
TypeScript
import react from '@vitejs/plugin-react-swc';
|
|
import svgr from 'vite-plugin-svgr';
|
|
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
import { configDefaults, defineConfig } from 'vitest/config';
|
|
|
|
const testFiles = ['./src/**/*.{test,spec}.{js,jsx,ts,tsx}'];
|
|
export default defineConfig({
|
|
resolve: {
|
|
conditions: ['@teable/source'],
|
|
},
|
|
ssr: {
|
|
resolve: {
|
|
conditions: ['@teable/source'],
|
|
externalConditions: ['@teable/source'],
|
|
},
|
|
},
|
|
plugins: [
|
|
react({
|
|
devTarget: 'es2022',
|
|
}),
|
|
tsconfigPaths(),
|
|
svgr({
|
|
// svgr options: https://react-svgr.com/docs/options/
|
|
svgrOptions: {},
|
|
}),
|
|
],
|
|
cacheDir: '../../.cache/vitest/nextjs-app',
|
|
test: {
|
|
globals: true,
|
|
environment: 'happy-dom',
|
|
passWithNoTests: false,
|
|
setupFiles: './config/tests/setupVitest.ts',
|
|
coverage: {
|
|
provider: 'v8',
|
|
include: ['src/**/*.{js,jsx,ts,tsx}', 'config/**/*.{js,jsx,ts,tsx}'],
|
|
},
|
|
include: testFiles,
|
|
exclude: [...configDefaults.exclude, '**/.next/**'],
|
|
},
|
|
});
|