ericmatthys.
ericmatthys.
CDCloudflare Developers
Created by ericmatthys. on 10/9/2024 in #pages-help
How best to use jsx / tsx entry point with `cloudflare pages dev`
I am using vanilla Cloudflare Pages Functions with cloudflare pages dev and I'm experimenting with @vercel/og using the plug-in (https://github.com/cloudflare/pages-plugins/tree/main/packages/vercel-og) as documented in the Generate arbitrary images section (https://developers.cloudflare.com/pages/functions/plugins/vercel-og/#generate-arbitrary-images). I have it working with plain js (React.createElement), but when using jsx like in the examples I get a parse error from es-module-lexer when miniflare is trying to get the entry points as the parser doesn't support jsx. Is there any way to use jsx / tsx without another framework that relies on building with vite or webpack? It seems to compile ok when using wrangler pages functions build, although it's not transforming the jsx into plain js.
2 replies
CDCloudflare Developers
Created by ericmatthys. on 5/30/2024 in #pages-help
wrangler.toml configuration beta in a monorepo
I had a question regarding this public beta feature. When deploying, does Cloudflare only look for wrangler.toml at the root of the repository? We have a monorepo and it'd be located in a subdirectory like packages/pages. I think it might be difficult to move to the root of the repository without support for custom paths (Pages does not support custom paths for the wrangler.toml configuration file). Thanks!
4 replies