Skip to content

Commit

Permalink
[node][remix] Update nft conditions to include "edge-light" for Edge …
Browse files Browse the repository at this point in the history
…Functions (#9700)
  • Loading branch information
TooTallNate committed Mar 21, 2023
1 parent 4c77dab commit 20bd71c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/node/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
2 changes: 1 addition & 1 deletion packages/remix/src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 20bd71c

Please sign in to comment.