Skip to main content

pnpm: Workspace API and WWW

pnpm-workspace-api-www.ts

const DEPLOY_CONFIG: DeployConfig = {
type: "google-cloudrun",
projectId: "google-project-id",
region: "europe-west6",
};
const config = {
appName: "test-app",
customerName: "pan",
// usually autodetected (packageManager field / lockfile); set
// explicitly here so the example is self-contained
packageManager: "pnpm",
builds: {
myWorkspace: {
type: "node",
},
},
components: {
api: {
dir: "api",
build: {
from: "myWorkspace",
},
deploy: DEPLOY_CONFIG,
},
www: {
dir: "www",
build: {
from: "myWorkspace",
cache: {
paths: [".next/cache"],
},
},
deploy: DEPLOY_CONFIG,
vars: {
public: {
API_URL: "${api:ROOT_URL}/graphql",
},
},
},
},
} satisfies Config;