wrangler pages dev when functions are not in root?

I keep my pages functions in a subfolder of my application, not at the top-level, but that causes problems when calling npx wrangler pages dev. I can't point it to that folder, or else the app does not start correctly (I get 404's), and I can't use npx wrangler pages dev -- <COMMAND> or else my functions are not found. Is there any way to support this structure?
2 Replies
quambo
quambo5mo ago
Had the same issue, ended up doing smth like this
export { onRequest } from '../../../trpc/src/index.ts';
export { onRequest } from '../../../trpc/src/index.ts';
No description
quambo
quambo5mo ago
so, just add a dummy function that re-exports some other file The command to start is
wrangler pages dev --compatibility-date=2023-11-26 --port 4010 -- bun dev
wrangler pages dev --compatibility-date=2023-11-26 --port 4010 -- bun dev