commit SGF2311

This commit is contained in:
2026-11-23 11:48:07 +02:00
parent cd9897df05
commit 82e447a6ab
18 changed files with 1952 additions and 338 deletions
+19
View File
@@ -0,0 +1,19 @@
import {build} from 'vite';
// Compile in memory: render checks do not need the dev server or its SSR transport.
// Resolve external packages to file URLs so native imports share React with the test.
export async function renderCheckModule(entry) {
const result=await build({
configFile:false,
logLevel:'error',
build:{
ssr:entry,
write:false,
minify:false,
rolldownOptions:{output:{paths:id=>import.meta.resolve(id)}},
},
});
const chunks=result.output.filter(item=>item.type==='chunk');
if(chunks.length!==1)throw new Error('Render check requires a single SSR chunk.');
return import('data:text/javascript;base64,'+Buffer.from(chunks[0].code).toString('base64'));
}