Hello, I use Netlify to deploy several websites from the monorepo managed by turborepo.
Websites are based on nuxt static generation.
During website generation, I need to also build a vue library, which is dependency for the websites. For that, I have configured turborepo pipeline to build this library before website generation starts. Locally the following command works completely fine:
turbo run generate --filter=website.com
However, if I use this build command in netlify, a build process will also run fine, but the deploy will contain 0 files.
I thought, that netlify grabs files a little earlier than needed, but the following build script didn’t help neither:
turbo run generate --filter=website.com && sleep 5
So currently I need to use the following script for all my repos in the monorepo:
npm run build --workspace=my-vue-lib && npm run generate --workspace=website.com
It’s frustrating, but at least my websites are deployed correctly.
As stated in the description, I am currently using a workaround: instead of using turborepo commands, I use a sequence of npm scripts calls with the same effect.
At the moment, management of these sequences becomes annoying, and I can easily imagine a situation when it is crucial to use turborepo.
I’ve just rechecked it:
Website build using turborepo command and empty publish directory - Netlify
Build using a sequence of npm scripts with a correct publish directory - Netlify
It seems like Netlify doesn’t include gitignored files to deploy, so I can’t check for sure which artifacts were generated.
As I remember, I also tried this path and the behavior is the same. Nuxt.js by default generates artifacts in both dist and .output/static. Dist is working directory for all my nuxt-based projects and it works fine with npm scripts on Netlify and with everything anywhere else.
Setting .output/public worked for me: Deploy details | Deploys | f-131225 | Netlify. There might be some issue reading the dist symlink that gets generated, but .output/public works fine.