Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More →
Socket
Sign inDemoInstall
Socket

@import-meta-env/babel

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@import-meta-env/babel - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

LICENSE

26

dist/index.js

@@ -101,6 +101,16 @@ var __create = Object.create;

// ../vite/src/env.ts
// ../shared/constant.ts
var virtualFile = "import-meta-env";
var virtualId = "\0" + virtualFile;
var uniqueVariableName = (() => {
const uniqueVariableName2 = "import_meta_env_unique_id_";
return uniqueVariableName2 + Array(256 - uniqueVariableName2.length).fill("x").join("");
})();
var envFilePath = ".env";
var envExampleFilePath = ".env.example";
// ../shared/resolve-env.ts
var import_dotenv = require("dotenv");
var import_picocolors = __toESM(require_picocolors());
var resolve = ({
var resolveEnv = ({
envFilePath: envFilePath2,

@@ -154,12 +164,2 @@ envExampleFilePath: envExampleFilePath2

// ../vite/src/shared.ts
var virtualFile = "import-meta-env";
var virtualId = "\0" + virtualFile;
var uniqueVariableName = (() => {
const uniqueVariableName2 = "import_meta_env_unique_id_";
return uniqueVariableName2 + Array(256 - uniqueVariableName2.length).fill("x").join("");
})();
var envFilePath = ".env";
var envExampleFilePath = ".env.example";
// src/index.ts

@@ -170,3 +170,3 @@ function importMetaEnvBabelPlugin({

}) {
const env = resolve({
const env = resolveEnv({
envFilePath,

@@ -173,0 +173,0 @@ envExampleFilePath

{
"name": "@import-meta-env/babel",
"version": "0.1.2",
"version": "0.1.3",
"description": "Load environment variables into import.meta.env object",

@@ -21,20 +21,17 @@ "license": "MIT",

"devDependencies": {
"@babel/core": "^7.17.5",
"dotenv": "^11.0.0 || ^12.0.4 || ^13.0.1 || ^14.3.2 || ^15.0.1 || ^16.0.0",
"esbuild": "^0.14.11",
"rimraf": "^3.0.2",
"standard-version": "^9.3.2",
"typescript": "^4.5.4",
"vite": "^2.7.13"
"dotenv": "^11.0.0 || ^12.0.4 || ^13.0.1 || ^14.3.2 || ^15.0.1 || ^16.0.0"
},
"peerDependencies": {
"dotenv": "^11.0.0 || ^12.0.4 || ^13.0.1 || ^14.3.2 || ^15.0.1 || ^16.0.0",
"vite": "^2.7.13"
"dotenv": "^11.0.0 || ^12.0.4 || ^13.0.1 || ^14.3.2 || ^15.0.1 || ^16.0.0"
},
"dependencies": {
"picocolors": "^1.0.0"
},
"scripts": {
"build": "rimraf dist bin && pnpm build-bundle",
"build-bundle": "esbuild src/index.ts --bundle --platform=node --target=node12 --external:vite --external:dotenv --outfile=dist/index.js",
"release": "standard-version -t babel --releaseCommitMessageFormat 'chore(release): @import-meta-env/babel@{{currentTag}}' --path . && pnpm build"
"release": "standard-version -t babel --releaseCommitMessageFormat 'chore(release): @import-meta-env/babel@{{currentTag}}' --path . && pnpm build",
"test": "echo \"no test\""
},
"readme": "# @import-meta-env/babel\n\n[![CI](https://github.com/iendeavor/import-meta-env/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/iendeavor/import-meta-env/actions/workflows/ci.yml)\n[![NPM version](https://img.shields.io/npm/v/@import-meta-env/babel.svg)](https://www.npmjs.com/package/@import-meta-env/babel)\n[![PRs Welcome](https://img.shields.io/badge/PRs-Welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\n\nThis plugin is intended to provide an approximation of some of [@import-meta-env/vite](https://github.com/iendeavor/import-meta-env/tree/develop/packages/vite) specific transformations when running the code in other environments, for example, running tests with a NodeJS based test runner.\n\n⚠ The functionality within these transformations should not be relied upon in production.\n\n## 🚀 Quick Start\n\nInstall and register the plugin:\n\n```sh\n$ npm i dotenv @import-meta-env/babel\n```\n\n```js\n// babel.config.js\nmodule.exports = {\n plugins: [\"module:@import-meta-env/babel\"],\n};\n```\n\nAdjust the test script in your package.json:\n\n```json\n{\n \"scripts\": {\n // If you have a `.env` file:\n \"test\": \"your-test-script\",\n // If you don't have a `.env` file:\n \"test\": \"cross-env S3_BUCKET=YOURS3BUCKET your-test-script\"\n }\n}\n```\n\nSee also:\n\n- [examples](./examples)\n- [@import-meta-env/vite](https://github.com/iendeavor/import-meta-env/tree/main/packages/vite) - Inject environment variables into the import.meta.env object after building the application instead of statically replacing it during production.\n"
"readme": "# @import-meta-env/babel\n\n[![CI](https://github.com/iendeavor/import-meta-env/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/iendeavor/import-meta-env/actions/workflows/ci.yml)\n[![NPM version](https://img.shields.io/npm/v/@import-meta-env/babel.svg)](https://www.npmjs.com/package/@import-meta-env/babel)\n[![PRs Welcome](https://img.shields.io/badge/PRs-Welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\n\nThis plugin is intended to provide an approximation of some of [import-meta-env](https://github.com/iendeavor/import-meta-env) specific transformations when running the code in other environments, for example, running tests with a NodeJS based test runner.\n\n⚠ The functionality within these transformations should not be relied upon in production.\n\n<br>\n\nThis project use [SemVer](https://semver.org/) for versioning. For the versions available, see the tags on this repository.\n\n## 🚀 Quick Start\n\nInstall and register the plugin:\n\n```sh\n$ npm i @import-meta-env/babel\n```\n\n```js\n// babel.config.js\nmodule.exports = {\n plugins: [\"module:@import-meta-env/babel\"],\n};\n```\n\nAdjust scripts in your package.json or elsewhere:\n\n```json\n{\n \"scripts\": {\n // If you have a `.env` file:\n \"foo\": \"foo\",\n // If you don't have a `.env` file:\n \"foo\": \"cross-env S3_BUCKET=YOURS3BUCKET foo\"\n }\n}\n```\n\nSee also:\n\n- [examples](./examples)\n- [@import-meta-env/cli](https://github.com/iendeavor/import-meta-env/tree/main/packages/cli) - A binary package is used to inject environment variables into those placeholders.\n- [@import-meta-env/unplugin](https://github.com/iendeavor/import-meta-env/tree/main/packages/unplugin) - Inject environment variables into the import.meta.env object after building the application instead of statically replacing it during production.\n\n## 📝 License\n\nThis project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details\n"
}

@@ -7,6 +7,10 @@ # @import-meta-env/babel

This plugin is intended to provide an approximation of some of [@import-meta-env/vite](https://github.com/iendeavor/import-meta-env/tree/develop/packages/vite) specific transformations when running the code in other environments, for example, running tests with a NodeJS based test runner.
This plugin is intended to provide an approximation of some of [import-meta-env](https://github.com/iendeavor/import-meta-env) specific transformations when running the code in other environments, for example, running tests with a NodeJS based test runner.
⚠ The functionality within these transformations should not be relied upon in production.
<br>
This project use [SemVer](https://semver.org/) for versioning. For the versions available, see the tags on this repository.
## 🚀 Quick Start

@@ -17,3 +21,3 @@

```sh
$ npm i dotenv @import-meta-env/babel
$ npm i @import-meta-env/babel
```

@@ -28,3 +32,3 @@

Adjust the test script in your package.json:
Adjust scripts in your package.json or elsewhere:

@@ -35,5 +39,5 @@ ```json

// If you have a `.env` file:
"test": "your-test-script",
"foo": "foo",
// If you don't have a `.env` file:
"test": "cross-env S3_BUCKET=YOURS3BUCKET your-test-script"
"foo": "cross-env S3_BUCKET=YOURS3BUCKET foo"
}

@@ -46,2 +50,7 @@ }

- [examples](./examples)
- [@import-meta-env/vite](https://github.com/iendeavor/import-meta-env/tree/main/packages/vite) - Inject environment variables into the import.meta.env object after building the application instead of statically replacing it during production.
- [@import-meta-env/cli](https://github.com/iendeavor/import-meta-env/tree/main/packages/cli) - A binary package is used to inject environment variables into those placeholders.
- [@import-meta-env/unplugin](https://github.com/iendeavor/import-meta-env/tree/main/packages/unplugin) - Inject environment variables into the import.meta.env object after building the application instead of statically replacing it during production.
## 📝 License
This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc