Registry / devops / modify-babel-preset

modify-babel-preset

JSON →
library3.2.1jsnpmunverified

Utility to create a modified Babel preset by cloning an existing preset and applying plugin additions, removals, or configuration overrides. Current version 3.2.1. Helps avoid manual preset duplication by flattening nested presets into a single plugin list and applying transformations. Key differentiator: plugin filtering works on resolved filenames for precise matching. Works best with npm 3. Release cadence: sporadic, last release 2017.

npm install modify-babel-preset
INSTALL
IMPORT
SIG · MODIFY-BABEL-PRESE
M
modify-babel-preset
devopsjavascriptv3.2.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import modifyBabelPreset from 'modify-babel-preset'
const modifyBabelPreset = require('modify-babel-preset')
ESM supported; require works in CJS contexts. Main export is a function.
default (CommonJS)
const modifyBabelPreset = require('modify-babel-preset')
CommonJS style with require. The package provides a single default function.
default (ESM named import)
import { modifyBabelPreset } from 'modify-babel-preset'
No named export; must use default import. Common mistake to destructure.

Creates a modified preset by removing the typeof-symbol transform and adding the React JSX transform to the es2015 preset.

const modifyBabelPreset = require('modify-babel-preset'); // Remove 'transform-es2015-typeof-symbol' and add 'transform-react-jsx' from the es2015 preset module.exports = modifyBabelPreset('es2015', { 'transform-es2015-typeof-symbol': false, 'transform-react-jsx': true });
Debug
Known issues
breakingIn v3.0.0, plugin paths are now resolved to filenames for matching; transformations must use plugin filenames (e.g., 'babel-plugin-transform-es2015-typeof-symbol' or its short name).
fix
Ensure plugin names in the modifications object match the resolved filename (short name works, but avoid full relative paths).
affects: >=3.0.0
gotchaThe preset must be installed as a dependency; modification does not install the preset automatically.
fix
Run 'npm install <preset-name>' before using modify-babel-preset.
affects: all
gotchaNested presets are flattened into a single plugins list; if a preset has nested presets, the resulting configuration may differ from the original preset's runtime behavior.
fix
Verify the final plugin order and configuration matches expectations, especially for presets that depend on ordering.
affects: all
deprecatedThis package is in maintenance mode; Babel 7+ uses @babel/preset-env and presets are less commonly modified in this way.
fix
Consider using babel-preset-env or write your own preset programmatically.
affects: >=3.0.0
Errors
Common errors & fixes
Cannot find module 'babel-preset-<name>'
Missing installed preset as a dependency.
fix
npm install <preset-name> --save-dev
Plugin '<name>' is not a valid plugin
Plugin name not recognized; may need full babel-plugin- prefix or incorrect name.
fix
Use the correct plugin name (e.g., 'transform-react-jsx' or 'babel-plugin-transform-react-jsx').
Expected a string for preset name
The first argument to modifyBabelPreset must be a preset name string.
fix
modifyBabelPreset('es2015', {...})
Upgrade
Version history
3.2.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
modify-babel-preset — npm install modify-babel-preset · libregistry