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
kian16mo ago
Not that I'm aware of It only really looks for workerd/browser conditions iirc
kian
kian16mo 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
kian16mo ago
conditions: ["workerd", "worker", "browser"],
conditions: ["workerd", "worker", "browser"],
Passle
PassleOP16mo ago
And theres no way to configure this in wrangler somehow?
kian
kian16mo 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
PassleOP16mo ago
Thanks, will do
Want results from more Discord servers?
Add your server