Commit 52602936 authored by Luke Sandberg's avatar Luke Sandberg Committed by Luke Sandberg

simplify patch

parent 04b54734
...@@ -1782,19 +1782,13 @@ export async function copy_vendor_react(task_) { ...@@ -1782,19 +1782,13 @@ export async function copy_vendor_react(task_) {
// to eliminate all promise tracking overhead — the chunks are // to eliminate all promise tracking overhead — the chunks are
// already loaded synchronously, so we just need to call // already loaded synchronously, so we just need to call
// __next_chunk_load__ for side effects and handle async modules. // __next_chunk_load__ for side effects and handle async modules.
if ( code = replaceFunctionBody(
(file.base.startsWith('react-server-dom-turbopack-server') || code,
file.base.startsWith('react-server-dom-turbopack-client')) && 'preloadModule',
(file.base.includes('.node.') || file.base.includes('.edge.')) `for (var chunks = metadata[1], i = 0; i < chunks.length; i++)
) {
code = replaceFunctionBody(
code,
'preloadModule',
`for (var chunks = metadata[1], i = 0; i < chunks.length; i++)
globalThis.__next_chunk_load__(chunks[i]); globalThis.__next_chunk_load__(chunks[i]);
return 4 === metadata.length ? requireAsyncModule(metadata[0]) : null;` return 4 === metadata.length ? requireAsyncModule(metadata[0]) : null;`
) )
}
file.data = code file.data = code
} else if (file.base === 'package.json') { } else if (file.base === 'package.json') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment