[node][remix] Update nft conditions to include "edge-light" for Edge Functions (#9700)

This commit is contained in:
Nathan Rajlich
2023-03-21 16:59:49 -07:00
committed by GitHub
parent 4c77dab5cb
commit 20bd71ce70
2 changed files with 4 additions and 2 deletions

View File

@@ -175,7 +175,9 @@ async function compile(
return source;
}
const conditions = isEdgeFunction ? ['worker', 'browser'] : undefined;
const conditions = isEdgeFunction
? ['edge-light', 'browser', 'module', 'import', 'require']
: undefined;
const { fileList, esmFileList, warnings } = await nodeFileTrace(
[...inputFiles],

View File

@@ -540,7 +540,7 @@ async function createRenderEdgeFunction(
const trace = await nodeFileTrace([handlerPath], {
base: rootDir,
processCwd: entrypointDir,
conditions: ['worker', 'browser'],
conditions: ['edge-light', 'browser', 'module', 'import', 'require'],
async readFile(fsPath) {
let source: Buffer | string;
try {