Closed electerious closed 7 years ago
It's because this is missing in the documentation. It would have saved me some hours: https://github.com/hughsk/envify/pull/44
Just to make it perfectly clear what's going on here (and for the reference of anyone else who goes hunting for this in the future):
bundle.transform(envify({ NODE_ENV: 'production' }));
will "envify" your code but will not touch any packages imported from node_modules
.
bundle.transform(envify({ NODE_ENV: 'production' }), { global: true });
will "envify" both your code and packages from node_modules
.
Thanks to @electerious for finding this and @MohsenEkhtiari for submitting a patch.
I've trouble getting the
envify/custom
version working. The following code bundles without errors, but still containsprocess.env.NODE_ENV
. Nothing has been replaced:The normal module however works fine.
Is there a difference between setting
process.env.NODE_ENV = 'production'
and passingNODE_ENV: 'production'
to the custom module?Node v6.7.0 envify v4.0.0
All tests are passing on my setup.