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

Load environment variables into import.meta.env object

  • 0.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.8K
decreased by-5.46%
Maintainers
1
Weekly downloads
 
Created
Source

@import-meta-env/babel

CI NPM version PRs Welcome

This plugin is intended to provide an approximation of some of @import-meta-env/vite 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.

🚀 Quick Start

Install and register the plugin:

$ npm i dotenv @import-meta-env/babel
// babel.config.js
module.exports = {
  plugins: ["module:@import-meta-env/babel"],
};

Adjust the test script in your package.json:

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

See also:

  • examples
  • @import-meta-env/vite - Inject environment variables into the import.meta.env object after building the application instead of statically replacing it during production.

FAQs

Package last updated on 26 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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