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
kian11mo ago
Not that I'm aware of It only really looks for workerd/browser conditions iirc
kian
kian11mo 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
kian11mo ago
conditions: ["workerd", "worker", "browser"],
conditions: ["workerd", "worker", "browser"],
Passle
Passle11mo ago
And theres no way to configure this in wrangler somehow?
kian
kian11mo 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
Passle11mo ago
Thanks, will do