Closed nicolashery closed 11 years ago
Hmm, that's strange... Browserify should be including process.env
as an empty object, but maybe that's changed in a recent version? process
should definitely be defined too. I'll look into it, thanks for the heads up! :)
console.log(process.env.NODE_ENV)
Without NODE_ENV
seems to work fine for me (it logs undefined
), are you able to post your code? Thanks :)
My bad. You're right, I checked and I had detectGlobals: false
in my Gruntfile.js
. I removed it and Browserify shims process
as expected. Still wrapping my head around Browserify's options :)
Thanks! Nicolas
I don't know if this is intended, but say the environment variable
NODE_ENV
is not defined in my shell, then the transform leavesprocess.env.NODE_ENV
as-is, which raises an error becauseprocess
is not defined.Maybe replace
process.env.NODE_ENV
withundefined
instead?