Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent optional dependencies to be installed on Heroku

part of my package.json:

"optionalDependencies": {
  "cypress": "^8.2.0",
  "cypress-commands": "^1.1.0",
  "cypress-expect": "^2.4.1",
  "cypress-file-upload": "^4.1.1"
},

I know that npm install --no-optional prevents optinal dependencies to be installed locally. But no idea how to pass that flag on Heroku

like image 468
Andrew Korin Avatar asked Oct 14 '25 05:10

Andrew Korin


1 Answers

heroku config:set NPM_CONFIG_OMIT=optional

And this is exactly what it's needed for. We don't want heroku spending time and resource loading and building test packages.

like image 184
David Fridley Avatar answered Oct 18 '25 02:10

David Fridley