mirror of
https://github.com/wu736139669/Monkey-Test.git
synced 2026-08-05 05:55:46 +00:00
29 lines
629 B
JavaScript
29 lines
629 B
JavaScript
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
|
|
exports["default"] = function (_ref) {
|
|
var Plugin = _ref.Plugin;
|
|
var t = _ref.types;
|
|
|
|
return new Plugin("inline-environment-variables", {
|
|
metadata: {
|
|
group: "builtin-pre"
|
|
},
|
|
|
|
visitor: {
|
|
MemberExpression: function MemberExpression(node) {
|
|
if (this.get("object").matchesPattern("process.env")) {
|
|
var key = this.toComputedKey();
|
|
if (t.isLiteral(key)) {
|
|
return t.valueToNode(process.env[key.value]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
};
|
|
|
|
module.exports = exports["default"]; |