viteflare icon indicating copy to clipboard operation
viteflare copied to clipboard

Support for worker monorepos

Open aleclarson opened this issue 4 years ago • 0 comments

Let's say I have multiple workers, and I want to use a PNPM workspace to share dependencies between them. A setup like this is possible, but I can only develop one worker at a time, sometimes forcing me to stop/start ViteFlare throughout the day.

Additionally, if I have a client-side app that uses multiple of these workers, I'm out of luck unless I string together a "mega worker" that imports all my workers and merges them.

What if ViteFlare generated this "mega worker" for you?

I'm open to ideas, but perhaps when some sort of .viteflare/routes.ts module exists, ViteFlare will use a generated "mega worker". The routes module would simply map Express-like routes to workers.

For production builds, I think you'd still want to publish the workers separately, to keep cold start times low.

aleclarson avatar Dec 14 '21 07:12 aleclarson