basic monorepo on cloudflare pages - git integration not working as expected?
Hi,
I am using turborepo's Vite preset with 2 vite apps in a monorepo ->
https://github.com/laurentlahmy/turborepo-vite
When I create a git integration in cloudflare pages to this repo, it runs the build scripts for each app and then uploads 53 files as assets, but doesn't serve the actually useful index.html.
- Is this expected?
- Am I supposed to run wrangler deploys in the build scripts of each vite app?
- What's the meaning of cloudflare pages monorepo support ? Is the cloudflare pages git integration not compatible with monorepos?
Thanks!
GitHub
GitHub - laurentlahmy/turborepo-vite
Contribute to laurentlahmy/turborepo-vite development by creating an account on GitHub.
Cloudflare Docs
Monorepos · Cloudflare Pages docs
While some apps are built from a single repository, Pages also supports apps with more complex setups. A monorepo is a repository that has multiple …
12 Replies
seems to be a bug with create vite@latest where you need to specify a NODE_VERSION = 20.9.0 (or any other compatible value), but it doesn't change my issue
@Walshy | Deploying 🙏
i'd need more info
sounds like your output dir isn't correct
I don't understand what the output dir is supposed to be since there's one for each vite app
this is the output in turbo.json
you make a project per app you deploy
so the output dir is for whichever one you're deploying
one project doesn't handle multiple sites
1 site per project
thanks. so you can't actually use git integration
why not?
root:
/
(or /project1
if it will handle the shared linking)
build command: npm run build
output dir: project1/dist
(or dist
if you're using /project1
root)
we have many customers using git + monorepos, it's very commonso you have a .git in project1 and a .git in project2?
well the .git folder is probably at the root, otherwise these are submodules
but either way, yeah you can do either or
ah ok I think I get it
thanks
you set up one git integration per project, even if they target the same repo
yes
they're distinct web apps
the project is for the site not for the repo
ok thanks!!