NextJS workers - how so I make sure the worker file is output to the build folder and excluded from the server bundle #66449
Unanswered
nickythorne
asked this question in
App Router
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using https://github.com/mstephen19/nanolith to manage worker threads in my nextjs application. This library relies on the workers being defined in a single deterministic file that can be loaded and ran independently.
In my case I have a
workers.tsin/app/lib/workers.ts, but it's currently getting bundled as part of the server bundle.How can I configure next or webpack to omit bundling this file, and instead ensure it is put as-is into the build folder in both dev and prod builds? I can then configure nanolith to use a specific file path for loading the worker file on disk in both scenarios.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions