
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
modify-babel-preset
Advanced tools
Create a modified babel preset based on an an existing preset.
npm i -S modify-babel-preset
A single function that takes an existing preset name and a mapping of plugin modifications to apply to that preset. Make sure you have the preset and any added plugins installed as dependencies.
newPreset = modifyBabelPreset(
'existing-preset-name',
{
'plugin-name': false, // remove
'other-plugin': true, // add
'foo': { loose:true } // add + config
}
);
Modification keys are babel plugin names (you can exclude the
babel-plugin-
prefix).
To add a plugin, pass true
, or a configuration object:
{
// just add a plugin without config:
'plugin-name': true,
// add a plugin and set its config
'other-plugin': { loose:true }
}
Note: adding a plugin that is already provided by the preset just overwrites its configuration.
To remove a plugin, pass false
:
{
'plugin-name': false
}
Here's a simple preset. Just this index.js
and a package.json pointing to it with the preset and plugin installed as dependencies.
var modifyBabelPreset = require('modify-babel-preset');
// just export the cloned, modified preset config:
module.exports = modifyBabelPreset('es2015', {
// remove the typeof x==='symbol' transform:
'transform-es2015-typeof-symbol': false,
// add the JSX transform:
'transform-react-jsx': true
});
FAQs
Create a modified babel preset based on an an existing preset.
The npm package modify-babel-preset receives a total of 3,482 weekly downloads. As such, modify-babel-preset popularity was classified as popular.
We found that modify-babel-preset 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.