stativ hash
This commit is contained in:
@@ -99,9 +99,16 @@ async function loadModuleSources(){
|
||||
return moduleSourcesPromise;
|
||||
}
|
||||
|
||||
function normalizeRuntimeSource(source){
|
||||
const text = String(source || '');
|
||||
// Note: Some generated source chunks may end with a literal \\n marker;
|
||||
// normalize only this trailing marker to avoid invalid Function() source.
|
||||
return text.endsWith('\\n') ? `${text.slice(0, -2)}\n` : text;
|
||||
}
|
||||
|
||||
export async function buildRuntimeSource(){
|
||||
const sources = await loadModuleSources();
|
||||
return `(() => {\n${sources.join('\n')}\n})();\n`;
|
||||
return `(() => {\n${sources.map(normalizeRuntimeSource).join('\n')}\n})();\n`;
|
||||
}
|
||||
|
||||
export async function startApp(){
|
||||
|
||||
Reference in New Issue
Block a user