Firstly, thanks for the info and support, I understand what youβre explaining.
Secondly, apologies to everyone for hijacking.
Thirdly, my issue is pebcak, apologies again. I misconfigured the monorepo build settings.
My situation isnβt quite as hrishikesh describes as Iβm using yarn workspaces, the root directory is a container of βworkspacesβ. This is the outline shape of repo,
gatsby-theme-main-entry - pulling from this repo @netlify build,
|- gatsby-theme-main-entry β [rootDir]
|
|-|-example-site
|-|-packages-|-gatsby-theme-mdx
|-|-packages-|-gatsby-theme-wordpress
|-| package.json (1)
// package.json (1)
{
"name": "gatsby-theme-main-entry",
"version": "0.0.1",
"description": "a container of yarn workspaces",
"workspaces": [
"example-site",
"packages/*"
],
"scripts": {
"build": "yarn workspace example-site build",
"build:clean": "yarn workspace example-site build:clean",
"build:clean:serve": "yarn workspace example-site build:clean:serve",
"clean": "yarn workspace example-site clean",
"serve": "yarn workspace example-site serve",
"test": "yarn workspace example-site test"
},
"dependencies": {
"node-fetch": "^3.3.2"
},
"engines": {
"node": ">=18.0.0"
}
}
Whatβs describe in hrishikesh example, the top-level package.json, in my situation is actually a workspace called example-site, and this can then consume themes included within the packages/* as a dependency. Allowing gastby-theme creation on the fly. Create a new dir in packages/* and include it in example-site package.json && gatsby-config and itβs good to go.
The site builds locally via netlify build and it also builds on Netlify but without the functions.
My build config is,
Base Dir:
Package Dir:
Build command: npm run build
Publish directory: example-site/public
As you can see, iβve installed node-fetch as a dependency of the root dir, and this does successfully build locally, but now Iβm wondering if I should change Package Dir to example-site ?
Yes!
Moved the node-fetch back into into example-site.package.json (removed from root pkg.json) and set the Package Dir to example-site.
Now my functions are deploying!