
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
babel-plugin-vitest
Advanced tools
babel-plugin-vitest)This a plugin for Babel that replaces instances of import.meta.vitest in your code with
undefined.
This plugin should be put in your babel config when you are using Vitest's In-Source Testing feature.
npm install --save-dev babel-plugin-vitest
babel.config.json
{
"plugins": [ "babel-plugin-vitest" ]
}
src/index.js
// the implementation
export function add(...args) {
return args.reduce((a, b) => a + b, 0)
}
// in-source test suites
if (import.meta.vitest) {
const { it, expect } = import.meta.vitest
it('add', () => {
expect(add()).toBe(0)
expect(add(1)).toBe(1)
expect(add(1, 2, 3)).toBe(6)
})
}
dist/index.js
// the implementation
export function add(...args) {
return args.reduce((a, b) => a + b, 0)
}
// in-source test suites
if (undefined) {
const { it, expect } = import.meta.vitest
it('add', () => {
expect(add()).toBe(0)
expect(add(1)).toBe(1)
expect(add(1, 2, 3)).toBe(6)
})
}
FAQs
import.meta.vitest -> undefined
The npm package babel-plugin-vitest receives a total of 1,499 weekly downloads. As such, babel-plugin-vitest popularity was classified as popular.
We found that babel-plugin-vitest demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.