We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Is there a plugin/flag that does similar to this but leaves only CommonJS support?
The text was updated successfully, but these errors were encountered:
I didn't test but this patch should work:
$ git diff diff --git a/index.js b/index.js index fd023f9..686b3f3 100644 --- a/index.js +++ b/index.js @@ -22,25 +22,11 @@ function prune(code) { estraverse.replace(ast, { leave: function leave(node, parent) { - var ret; - - if ('IfStatement' === node.type) { - if ('BinaryExpression' !== node.test.type) return; - - if ('self' === node.test.left.argument.name) { - node.alternate = null; - } else if ('global' === node.test.left.argument.name) { - ret = node.alternate; - } - - return ret; - } - if ( 'BlockStatement' === node.type && 'FunctionExpression' === parent.type ) { - return node.body[0].alternate.alternate; + return node.body[0].consequent; } } });
Anyway I think it's out of the scope of this module.
Sorry, something went wrong.
No branches or pull requests
Is there a plugin/flag that does similar to this but leaves only CommonJS support?
The text was updated successfully, but these errors were encountered: