add more plugins, rename some

This commit is contained in:
Sebastian McKenzie
2015-09-15 06:12:46 +01:00
parent 3e8cbc60eb
commit 9969224a93
328 changed files with 2013 additions and 1543 deletions

View File

@@ -0,0 +1,18 @@
export default function ({ types: t }) {
return {
visitor: {
MemberExpression(path) {
if (path.matchesPattern("process.env.NODE_ENV")) {
path.replaceWith(t.valueToNode(process.env.NODE_ENV));
if (path.parentPath.isBinaryExpression()) {
var evaluated = path.parentPath.evaluate();
if (evaluated.confident) {
path.parentPath.replaceWith(t.valueToNode(evaluated.value));
}
}
}
}
}
};
}