mirror of
https://github.com/ZSeven-W/openpencil.git
synced 2026-06-01 03:14:29 +07:00
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
import { defineConfig } from 'vitest/config'
|
|
import { devtools } from '@tanstack/devtools-vite'
|
|
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
|
|
import viteReact from '@vitejs/plugin-react'
|
|
import viteTsConfigPaths from 'vite-tsconfig-paths'
|
|
import { fileURLToPath, URL } from 'node:url'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
import { nitro } from 'nitro/vite'
|
|
|
|
const isElectronBuild = process.env.BUILD_TARGET === 'electron'
|
|
|
|
const config = defineConfig({
|
|
test: {
|
|
teardownTimeout: 1000,
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
},
|
|
},
|
|
ssr: {
|
|
external: ['@opencode-ai/sdk'],
|
|
},
|
|
plugins: [
|
|
devtools(),
|
|
nitro({
|
|
rollupConfig: { external: [/^@sentry\//, /^@opencode-ai\//] },
|
|
serverDir: './server',
|
|
...(isElectronBuild ? { preset: 'node-server' } : {}),
|
|
}),
|
|
// this is the plugin that enables path aliases
|
|
viteTsConfigPaths({
|
|
projects: ['./tsconfig.json'],
|
|
}),
|
|
tailwindcss(),
|
|
tanstackStart(),
|
|
viteReact(),
|
|
],
|
|
})
|
|
|
|
export default config
|