Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
babel-plugin-transform-vite-meta-env
Advanced tools
babel plugin that emulates vite's import.meta.env functionality
Please note: this plugin is intended to provide an approximation of some of Vite specific transformations when running the code in non-Vite environment, for example, running tests with a NodeJS based test runner.
The functionality within these transformations should not be relied upon in production.
In
const mode = import.meta.env.MODE;
const baseUrl = import.meta.env.BASE_URL;
const nodeEnv = import.meta.env.NODE_ENV;
const dev = import.meta.env.DEV;
const prod = import.meta.env.PROD;
const viteVar = import.meta.env.VITE_VAR;
const other = import.meta.env.OTHER;
Out
const mode = process.env.MODE;
const baseUrl = '/';
const nodeEnv = process.env.NODE_ENV || 'test';
const dev = process.env.NODE_ENV !== 'production';
const prod = process.env.NODE_ENV === 'production';
const viteVar = process.env.env.VITE_VAR;
const other = undefined;
npm install --save-dev babel-plugin-transform-vite-meta-env
{
"plugins": ["babel-plugin-transform-vite-meta-env"]
}
babel --plugins babel-plugin-transform-vite-meta-env script.js
require('@babel/core').transformSync('code', {
plugins: ['babel-plugin-transform-vite-meta-env']
})
FAQs
babel plugin that emulates vite's import.meta.env functionality
The npm package babel-plugin-transform-vite-meta-env receives a total of 96,112 weekly downloads. As such, babel-plugin-transform-vite-meta-env popularity was classified as popular.
We found that babel-plugin-transform-vite-meta-env demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
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.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.