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
I ran into #7 again today, which made me wonder if we might improve the default behavior or envify.
Instead of having to choose between require('envify') and require('envify/custom') this behavior might be more intuitive.
varenvify=require('envify');// detects the process.env.NODE_ENV variablebrowserify().transform(envify())// manually override the environmentbrowserify().transform(envify({env: 'custom'});
Let me know what you think, if you approve I'll PR the changes.
The text was updated successfully, but these errors were encountered:
So the reason for this API being as it is right now is to cater to transforms specified from either the CLI or within a package.json file: in this case, you're expected to export a function with the transform signature, i.e.:
The only way to get the behaviour you're after is to check the first argument for an Object vs. String, which could be a bit quirky but might work! Would definitely want this to be a major version bump though. If you wanna give it a shot send a PR and we'll see :)
I ran into #7 again today, which made me wonder if we might improve the default behavior or
envify
.Instead of having to choose between
require('envify')
andrequire('envify/custom')
this behavior might be more intuitive.Let me know what you think, if you approve I'll PR the changes.
The text was updated successfully, but these errors were encountered: