There is a similar topic in this regard for npm install –force.
We recently jumped on the hype train and switched to pnpm.
I use pnpm install –prod on local and can confirm that only the production and optional dependencies are installed. The devDependencies are ignored.
I add the installCommand to my vercel.json and get confirmation of the correct install command in the vercel cli as well as in the vercel dashboard for the deployment.
However, the production flag seems to be ignored since I can see that the devDependencies are still installed in the build log.
[18:01:50.830] Running build in Washington, D.C., USA (East) – iad1
[18:01:50.831] Build machine configuration: 4 cores, 8 GB
[18:01:50.845] Retrieving list of deployment files...
[18:01:50.950] Previous build caches not available
[18:01:51.578] Downloading 1279 deployment files...
[18:01:56.371] Running "vercel build"
[18:01:56.786] Vercel CLI 46.0.3
[18:01:57.622] Installing dependencies...
[18:01:57.623] Detected `pnpm-lock.yaml` version 9 generated by pnpm@10.x with package.json#packageManager pnpm@10.10.0
[18:02:00.043] Lockfile is up to date, resolution step is skipped
[18:02:00.077] Progress: resolved 1, reused 0, downloaded 0, added 0
[18:02:00.151] Packages: +350
[18:02:00.151] ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[18:02:01.091] Progress: resolved 350, reused 0, downloaded 106, added 51
[18:02:02.091] Progress: resolved 350, reused 0, downloaded 296, added 209
[18:02:02.975] Progress: resolved 350, reused 0, downloaded 350, added 350, done
[18:02:03.113] .../esbuild@0.25.9/node_modules/esbuild postinstall$ node install.js
[18:02:03.198] .../esbuild@0.25.9/node_modules/esbuild postinstall: Done
[18:02:03.388]
[18:02:03.388] dependencies:
[18:02:03.388] + jsonwebtoken 9.0.2
[18:02:03.388] + pg 8.15.6
[18:02:03.388]
[18:02:03.388] optionalDependencies:
[18:02:03.388] + @aws-sdk/client-s3 3.876.0
[18:02:03.388] + @aws-sdk/cloudfront-signer 3.873.0
[18:02:03.388] + @aws-sdk/s3-request-presigner 3.876.0
[18:02:03.389] + @node-saml/node-saml 5.1.0
[18:02:03.389] + nodemailer 6.10.1
[18:02:03.389]
[18:02:03.389] devDependencies:
[18:02:03.389] + @biomejs/biome 2.0.0
[18:02:03.389] + clean-jsdoc-theme 4.3.0
[18:02:03.389] + codi-test-framework 1.0.37
[18:02:03.389] + concurrently 9.2.1
[18:02:03.389] + cookie-parser 1.4.7
[18:02:03.389] + dotenv 16.6.1
[18:02:03.389] + esbuild 0.25.9
[18:02:03.389] + express 5.1.0
[18:02:03.389] + express-rate-limit 7.5.1
[18:02:03.389] + nodemon 3.1.10
[18:02:03.389]
[18:02:03.514] Done in 3.9s using pnpm v10.10.0
[18:02:07.650] Build Completed in /vercel/output [10s]
[18:02:07.995] Deploying outputs...
[18:02:15.413] Deployment completed
[18:02:16.302] Creating build cache...
[18:02:24.954] Created build cache: 8.651s
[18:02:24.954] Uploading build cache [46.21 MB]
[18:02:25.699] Build cache uploaded: 744.8ms
I deleted the pnpm-lock.yaml and forced a redeploy. The dependencies installed are no longer logged. But the number 350 has not changed. I would expect around 150 without the development dependencies.