@import-meta-env/babel
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -160,3 +160,3 @@ "use strict"; | ||
MetaProperty(path, state) { | ||
var _a, _b, _c; | ||
var _a, _b, _c, _d, _e; | ||
if (!t.isMemberExpression(path.parentPath.node)) | ||
@@ -168,7 +168,9 @@ return; | ||
return; | ||
const shouldInlineEnv = ((_a = state.opts) == null ? void 0 : _a.shouldInlineEnv) ?? process.env.NODE_ENV !== "production"; | ||
if (((_b = (_a = path.parentPath.node.object) == null ? void 0 : _a.meta) == null ? void 0 : _b.name) !== "import") | ||
return; | ||
const shouldInlineEnv = ((_c = state.opts) == null ? void 0 : _c.shouldInlineEnv) ?? process.env.NODE_ENV !== "production"; | ||
if (shouldInlineEnv) { | ||
if (env === void 0) { | ||
let envFilePath2 = ((_b = state.opts) == null ? void 0 : _b.env) || envFilePath; | ||
let envExampleFilePath = (_c = state.opts) == null ? void 0 : _c.example; | ||
let envFilePath2 = ((_d = state.opts) == null ? void 0 : _d.env) || envFilePath; | ||
let envExampleFilePath = (_e = state.opts) == null ? void 0 : _e.example; | ||
if (envExampleFilePath === void 0) { | ||
@@ -175,0 +177,0 @@ throw Error( |
{ | ||
"name": "@import-meta-env/babel", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "Load environment variables into import.meta.env object", | ||
@@ -45,6 +45,6 @@ "license": "MIT", | ||
"@babel/core": "7.19.6", | ||
"@types/babel-plugin-tester": "^9.0.5", | ||
"@types/babel__core": "^7.1.19", | ||
"babel-plugin-tester": "^10.1.0" | ||
"@types/babel-plugin-tester": "9.0.5", | ||
"@types/babel__core": "7.1.19", | ||
"babel-plugin-tester": "10.1.0" | ||
} | ||
} |
10945
188