-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch from jstransform to acorn #30
Conversation
@zertosh the first example's functionality is necessary so that you can still use it from the command-line and package.json files, e.g.: browserify -t [ envify --NODE_ENV production ] {
"browserify": {
"transform": [
["envify", { "NODE_ENV": "production" }]
]
}
} I think the better solution would be to deprecate |
@hughsk Ah yeah - I didn't think about options from a Thinking about it some more, I don't think it's possible to deprecate I also ran some benchmarks envifying React: before:
after:
|
@hughsk Since this is such a huge change, I'm not going to merge it w/o your final blessing 😇 |
I was just noticing yesterday how the current API is a bit clunky and found this issue. It would be nice if |
@zertosh I see what you mean. I guess this is as good as it gets with the current browserify API. For consistency of API usage I would just suggest maybe not even documenting |
PR #52 (which is already merged) superseded this one. I think this PR can be closed now. |
Hey @hughsk, since jstransform is getting deprecated, I rewrote the plugin using acorn and directly updating the source.
Since this is such a substantial rewrite, if it's cool with you, I'd additionally like to change the API a bit. Basically, move the
args
parsing to the start of the transform and expose anenvify.configure()
instead of anenvify/custom.js
. Moving theargs
parsing means: