transform-inline-environment-variables: replace -> replaceWith - fixes T6724

This commit is contained in:
Henry Zhu 2015-12-02 21:53:12 -05:00
parent 53877ec158
commit 8cf1b418fc

View File

@ -5,7 +5,7 @@ export default function ({ types: t }) {
if (path.get("object").matchesPattern("process.env")) { if (path.get("object").matchesPattern("process.env")) {
let key = path.toComputedKey(); let key = path.toComputedKey();
if (t.isStringLiteral(key)) { if (t.isStringLiteral(key)) {
path.replace(t.valueToNode(process.env[key.value])); path.replaceWith(t.valueToNode(process.env[key.value]));
} }
} }
} }