diff --git a/packages/babel-plugin-transform-inline-environment-variables/src/index.js b/packages/babel-plugin-transform-inline-environment-variables/src/index.js index c4d30464c0..46381344dc 100644 --- a/packages/babel-plugin-transform-inline-environment-variables/src/index.js +++ b/packages/babel-plugin-transform-inline-environment-variables/src/index.js @@ -5,7 +5,7 @@ export default function ({ types: t }) { if (path.get("object").matchesPattern("process.env")) { let key = path.toComputedKey(); if (t.isStringLiteral(key)) { - path.replace(t.valueToNode(process.env[key.value])); + path.replaceWith(t.valueToNode(process.env[key.value])); } } }