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!
Turbo
Vite | Turborepo
Learn more about using Vite in your monorepo.
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
laurent
laurent2mo ago
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 🙏
Walshy
Walshy2mo ago
i'd need more info sounds like your output dir isn't correct
laurent
laurent2mo ago
I don't understand what the output dir is supposed to be since there's one for each vite app
laurent
laurent2mo ago
this is the output in turbo.json
No description
Walshy
Walshy2mo ago
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
laurent
laurent2mo ago
thanks. so you can't actually use git integration
Walshy
Walshy2mo ago
why not?
monorepo/
project1/
dist/
index.html
project2/
out/
index.html
shared/
src/
monorepo/
project1/
dist/
index.html
project2/
out/
index.html
shared/
src/
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 common
laurent
laurent2mo ago
so you have a .git in project1 and a .git in project2?
Walshy
Walshy2mo ago
well the .git folder is probably at the root, otherwise these are submodules but either way, yeah you can do either or
laurent
laurent2mo ago
ah ok I think I get it thanks you set up one git integration per project, even if they target the same repo
Walshy
Walshy2mo ago
yes they're distinct web apps the project is for the site not for the repo
laurent
laurent2mo ago
ok thanks!!
Want results from more Discord servers?
Add your server