mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
52 lines
1.1 KiB
TypeScript
52 lines
1.1 KiB
TypeScript
import { defineConfig } from 'vitest/config';
|
|
import { sveltekit } from '@sveltejs/kit/vite';
|
|
|
|
const config = defineConfig({
|
|
plugins: [sveltekit()],
|
|
optimizeDeps: {
|
|
include: ['echarts', 'prismjs']
|
|
},
|
|
ssr: {
|
|
noExternal: [
|
|
'@analytics/google-analytics',
|
|
'@sentry/browser',
|
|
'@sentry-internal/tracing',
|
|
'analytics',
|
|
'dayjs',
|
|
'dotenv',
|
|
'echarts',
|
|
'prismjs',
|
|
'zrender'
|
|
]
|
|
},
|
|
server: {
|
|
port: 3000
|
|
}
|
|
});
|
|
|
|
const testConfig = defineConfig({
|
|
resolve: {
|
|
// hotfix for https://github.com/vitest-dev/vitest/issues/2834
|
|
conditions: ['browser']
|
|
},
|
|
test: {
|
|
include: ['tests/unit/**/*.test.ts'],
|
|
environment: 'jsdom',
|
|
globals: true,
|
|
pool: 'threads',
|
|
setupFiles: ['./tests/unit/setup.ts'],
|
|
server: {
|
|
deps: {
|
|
inline: ['@analytics/type-utils']
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
export default process.env.VITEST
|
|
? {
|
|
...config,
|
|
...testConfig
|
|
}
|
|
: config;
|