1 | initial version |
The process for utilizing Yarn Workspaces to deploy a Monorepo to Vercel involves the following steps:
package.json
file in the root directory with the following properties:{
"name": "my-monorepo",
"version": "0.0.1",
"private": true,
"workspaces": [
"packages/*"
]
}
vercel.json
file in the root directory with the following configuration:{
"builds": [
{ "src": "packages/*", "use": "@vercel/node" }
]
}
In each package directory, create a package.json
file that defines the package and its dependencies.
In the root directory, run yarn install
to install all the dependencies for all packages.
Use yarn workspace <package-name> <command>
to run any commands specific to a package.
In the Vercel dashboard, select your repository and configure the deployment settings. Make sure to set the build command to yarn
and the output directory to ./packages/*
.
Deploy your monorepo to Vercel and enjoy the benefits of a fully functional monorepo!