You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A question of to what value should process.env.NODE_ENV default to if not set, is a quite important one. There is plenty of discussion about it out there, ones advocating 'production' and others 'development'. This can be confusing.
I suggest publishing the following suggestion somewhere in guides chapter.
If process.env.NODE_ENV is undefined, the code should assume default value as follows:
generic library code: 'development' as the best choice when writing new code;
(server) application code: 'development' because in real life this code is launced by script or loader, explicitly setting the NODE_ENV value;
utility package code: 'production', because it's likely a developer wants to debug his/her own code, not the code of installed npm packages or tools like npm or rimraf.
The text was updated successfully, but these errors were encountered:
Probably not relevant anymore as this guide doesn't exist anymore, and with the learn pages from nodejs.dev coming here soon, should also not be relevant anymore.
A question of to what value should
process.env.NODE_ENV
default to if not set, is a quite important one. There is plenty of discussion about it out there, ones advocating 'production' and others 'development'. This can be confusing.I suggest publishing the following suggestion somewhere in guides chapter.
If
process.env.NODE_ENV
is undefined, the code should assume default value as follows:'development'
as the best choice when writing new code;'development'
because in real life this code is launced by script or loader, explicitly setting the NODE_ENV value;'production'
, because it's likely a developer wants to debug his/her own code, not the code of installed npm packages or tools like npm or rimraf.The text was updated successfully, but these errors were encountered: