import { defineConfig } from 'vitest/config';
import { transform } from '@solidjs/compiler';
import { fileURLToPath } from 'node:url';
export default defineConfig({
plugins: [
{
name: 'solid-native-oxc',
enforce: 'pre',
transform(source, id) {
const filename = id.split('?')[0];
if (!filename.endsWith('.tsx')) return;
const result = transform(source, {
filename,
generate: 'universal',
moduleName: '@solid-native/runtime',
sourceMap: true,
});
return { code: result.code, map: result.map };
},
},
],
resolve: {
conditions: ['browser'],
alias: {
'@solid-native/runtime': fileURLToPath(new URL('./src/renderer/runtime.ts', import.meta.url)),
},
},
ssr: { resolve: { conditions: ['browser'] } },
test: {
include: ['test/**/*.test.{ts,tsx}'],
environment: 'node',
server: { deps: { inline: [/^solid-js/, /^@solidjs\//] } },
testTimeout: 10_000,
maxWorkers: 2,
},
});