Closed aaronbeall closed 6 years ago
In node, process
and process.env
are always defined.
If bundling for a different environment, it is standard practice to have the bundler inject a value for process.env.NODE_ENV
.
For instance, if using webpack, you would use the webpack DefinePlugin
to overwrite this lookup with a static value.
Or, like the readme says, use Envify if using Browserify as a bundler. Most bundling systems have a standard way of doing this.
The onus is on the consumer to make sure this is defined, not the package maintainer.
This is more a question than an issue, sorry if there was a better place to ask this.
I noticed the code that accesses
process.env.NODE_ENV
. Isn't it possible thatprocess
itself could be undefined, leading to an error instrict mode
?