Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
babel-plugin-transform-require-extensions
Advanced tools
A Babel plugin that transforms specified require path file extensions.
A Babel plugin that transforms specified require
path file extensions.
This is useful for building dual ESM/CJS packages. File names with extensions are mandatory in ESM import
specifiers in .mjs
files. After transpiling this to CJS in .js
files, the hardcoded .mjs
extensions in the require
paths must be transformed to .js
. Alternatively, sometimes it’s safe to remove the extensions as Node.js in CJS mode can automatically resolve .js
file extensions.
To install from npm run:
npm install babel-plugin-transform-require-extensions --save-dev
Configure Babel to use the plugin:
{ "plugins": ["transform-require-extensions"] }
This plugin must run after any ESM to CJS transpilation occurs.
By default .mjs
extensions are transformed to .js
. The extensions
option can be used to specify extension replacements. For example, to remove .mjs
extensions:
{
"plugins": [
[
"transform-require-extensions",
{
"extensions": {
".mjs": ""
}
}
]
]
}
2.0.1
hard-rejection
dev dependency to ensure unhandled rejections in tests exit the process with an error.test:prettier
script.semi
to the default, true
.assert
imports.FAQs
A Babel plugin that transforms specified require path file extensions.
The npm package babel-plugin-transform-require-extensions receives a total of 2 weekly downloads. As such, babel-plugin-transform-require-extensions popularity was classified as not popular.
We found that babel-plugin-transform-require-extensions 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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.