I am running the node server after the application build, pointing to the dist folder using: node dist/server/main.js. The server points to production environment by default (I think that's what webpack does by default).

In order to make it reference the local environment I tried the 2 scripts below:

"start": "cross-env NODE_ENV=local ./node_modules/.bin/cross-env node 
dist/server/main.js" 

and

"start": "cross-env NODE_ENV=local node dist/server/main.js"

These does not work. Is there any way if my server could point to the local/ development environment instead of always pointing to production? Thanks!

1 Answers

0
0xRm On

Your crossenv syntax looks wrong. It should probably be:

"start": "cross-env NODE_ENV=local node dist/server/main.js"