wranglers handling of node module resolutioncustom export conditions

Im trying to use a package in my worker that depends on package export conditions (notably the ‘development’ condition). I was expecting wrangler dev to use the development export condition, but it looks like it doesnt. Is there any way to provide which export conditions wrangler should use?
6 Replies
kian
kian17mo ago
Not that I'm aware of It only really looks for workerd/browser conditions iirc
kian
kian17mo ago
Bundling · Cloudflare Workers docs
By default, Wrangler bundles your Worker code using esbuild . This means that Wrangler has built-in support for importing modules from npm defined in …
kian
kian17mo ago
conditions: ["workerd", "worker", "browser"],
conditions: ["workerd", "worker", "browser"],
Passle
PassleOP17mo ago
And theres no way to configure this in wrangler somehow?
kian
kian17mo ago
Nope You could open an issue at https://github.com/cloudflare/workers-sdk/issues and ask them to make it configurable, or add "development" to the conditions for wrangler dev.
Passle
PassleOP17mo ago
Thanks, will do
Want results from more Discord servers?
Add your server