Next.js Discord

Discord Forum

Browser vs worker dependencies

Unanswered
Barbary Lion posted this in #help-forum
Open in Discord
Barbary LionOP
Hello y'all,
Im trying to use a dependency inside a webworker in nextjs. The dependency exposes a different entrypoint for workers in its package.json, how to get nextjs to use the worker entrypoint for bundling instead of the default browser one. I only want to do this for the one package tho.

Some help would be highly appreciated.

1 Reply

Barbary LionOP
FYI: The easiest way for me was to apply an pnpm patch to just swap the exports. This is not my preferred way to fix this tho more of a wacky workaround.