kravetsone / esbuild-plugin-autoload

Bun/esbuild plugin for work with autoload at runtime
6 stars 2 forks source link

How to use this during vite build? #8

Open Bewinxed opened 2 days ago

Bewinxed commented 2 days ago

Hello, I’m using this inside elysia inside a sveltekit project, the route is /api/[…slugs]/+server.ts which exposes a catchall router that passes requests to elysia.

how can i preload all the routes and add them to sveltekit when building with bun and vite?

thank you

Bewinxed commented 1 day ago

I turned autoload into a cli command, which executes the same logic done in the runtime and flattens all routes to a routes.ts that I export and use in the main Elysia handler.

this is a workaround for now…

kravetsone commented 5 hours ago

I turned autoload into a cli command, which executes the same logic done in the runtime and flattens all routes to a routes.ts that I export and use in the main Elysia handler.

this is a workaround for now…

maybe i can rewrite to unplugin-autoload with unplugin.unjs.io