From 88544ec85e4eb032a686b0ae14eef70c97340a58 Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Mon, 23 Dec 2024 12:47:03 +0000 Subject: [PATCH] Add clarifying comment --- packages/wrangler/src/deployment-bundle/resolve-entry.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/wrangler/src/deployment-bundle/resolve-entry.ts b/packages/wrangler/src/deployment-bundle/resolve-entry.ts index a5ed6ef9d3f2..cfb5ef54c55d 100644 --- a/packages/wrangler/src/deployment-bundle/resolve-entry.ts +++ b/packages/wrangler/src/deployment-bundle/resolve-entry.ts @@ -19,6 +19,9 @@ export function resolveEntryWithMain( relativePath: string; projectRoot: string; } { + // The project root is where the user defined the Worker via the Wrangler configuration (or the current working directory). + // The entry root is the base path used in bundling the source code for the Worker, + // which may be different from the project root if the Wrangler was redirected to use a different Wrangler configuration file. const projectRoot = path.resolve(path.dirname(config.userConfigPath ?? ".")); const entryRoot = path.resolve(path.dirname(config.configPath ?? ".")); const absolutePath = path.resolve(entryRoot, main);