-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Labels
bugSomething that isn't workingSomething that isn't workingwranglerRelating to the Wrangler CLI toolRelating to the Wrangler CLI tool
Description
The wrangler configuration has define
s that should be applied by ESBuild bundling:
However they are only applied when process.env.NODE_ENV
is defined at build time:
workers-sdk/packages/wrangler/src/deployment-bundle/bundle.ts
Lines 386 to 396 in 7d0417b
...(process.env.NODE_ENV && { | |
define: { | |
...(defineNavigatorUserAgent | |
? { "navigator.userAgent": `"Cloudflare-Workers"` } | |
: {}), | |
// use process.env["NODE_ENV" + ""] so that esbuild doesn't replace it | |
// when we do a build of wrangler. (re: https://github.com/cloudflare/workers-sdk/issues/1477) | |
"process.env.NODE_ENV": `"${process.env["NODE_ENV" + ""]}"`, | |
...define, | |
}, | |
}), |
That is process.env.NODE_ENV &&
gates too many values.
This was fixed in #7932 and further reverted in #7967 because the initial PR lacks tests.
We should re-introduce the initial PR with tests
Metadata
Metadata
Assignees
Labels
bugSomething that isn't workingSomething that isn't workingwranglerRelating to the Wrangler CLI toolRelating to the Wrangler CLI tool
Type
Projects
Status
Backlog