transform-inline-environment-variables: replace -> replaceWith - fixes T6724
This commit is contained in:
parent
53877ec158
commit
8cf1b418fc
@ -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]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user