Vercel: now's npm install excludes devDependencies

Created on 2 Oct 2016  路  4Comments  路  Source: vercel/vercel

Not sure if I missed this somewhere, but now seems to _not_ install devDependencies when deploying. My build script uses webpack, which is defined as a devDependency, so it can't find it. Is this supported? Do I need to list all dependencies as regular dependencies?

Most helpful comment

right I'm already using -p, but I want to set NODE_ENV=production to pass it down to React so it uses prod mode, via DefinePlugin (see https://facebook.github.io/react/docs/package-management.html)

In case anyone arrives here, instead of using now -e NODE_ENV=production, I just made my build script look like this:

    "build": "NODE_ENV=production webpack -p",

it would be nice to add some docs indicating that NODE_ENV determines what dependencies are installed. thanks @leo !

All 4 comments

Are you setting NODE_ENV to "production" somewhere?

@leo, thanks for getting back to me.
In fact it is-- I want to deploy a production build, so I set it to production so webpack builds the production build. What would be the expected workflow for this scenario?

right I'm already using -p, but I want to set NODE_ENV=production to pass it down to React so it uses prod mode, via DefinePlugin (see https://facebook.github.io/react/docs/package-management.html)

In case anyone arrives here, instead of using now -e NODE_ENV=production, I just made my build script look like this:

    "build": "NODE_ENV=production webpack -p",

it would be nice to add some docs indicating that NODE_ENV determines what dependencies are installed. thanks @leo !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

erhankaradeniz picture erhankaradeniz  路  3Comments

Ugarz picture Ugarz  路  3Comments

pex picture pex  路  3Comments

foundryspatial-duncan picture foundryspatial-duncan  路  3Comments

Rowno picture Rowno  路  3Comments