vite-plugin-env-compatible
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var __create = Object.create; | ||
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
@@ -24,5 +24,3 @@ var __getProtoOf = Object.getPrototypeOf; | ||
var __toModule = (module) => { | ||
if (module && module.__esModule) | ||
return module; | ||
return __exportStar(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", {value: module, enumerable: true})), module); | ||
return __exportStar(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? {get: () => module.default, enumerable: true} : {value: module, enumerable: true})), module); | ||
}; | ||
@@ -175,3 +173,3 @@ | ||
}); | ||
import_dotenv_expand.default({ | ||
(0, import_dotenv_expand.default)({ | ||
parsed, | ||
@@ -213,6 +211,8 @@ ignoreProcessEnv | ||
const myDefine = {}; | ||
if (_optionalChain([options, 'access', _ => _.mountedPath, 'optionalAccess', _2 => _2.startsWith, 'call', _3 => _3("process.env")])) { | ||
myDefine["process.env.VITE"] = JSON.stringify(true); | ||
} | ||
Object.keys(env).map((key) => { | ||
const value = env[key]; | ||
myDefine[`${options.mountedPath}.${key}`] = JSON.stringify(value); | ||
myDefine[`${options.mountedPath}`] = {}; | ||
}); | ||
@@ -219,0 +219,0 @@ config.define = { |
{ | ||
"name": "vite-plugin-env-compatible", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Environment Variables Compatible", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11408
246