Registry / devops / babel-preset-compat

babel-preset-compat

JSON →
library0.22.4jsnpmunverified

A Babel preset that enables COMPAT mode for JavaScript transpilation, targeting older browsers and environments. Current stable version is 0.22.4. This package is part of the compat ecosystem, designed to simplify polyfilling and transpilation for maximum compatibility with legacy platforms. It differentiates itself by focusing specifically on 'compat' mode, reducing config overhead. However, it lacks documentation and has been in maintenance mode with no recent updates.

npm install babel-preset-compat
INSTALL
IMPORT
SIG · BABEL-PRESET-COMPA
B
babel-preset-compat
devopsjavascriptv0.22.4
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 compatPreset from 'babel-preset-compat'
const compatPreset = require('babel-preset-compat').default
Default import; CJS users can use require('babel-preset-compat') directly.
config
import compatPreset from 'babel-preset-compat'; export default { presets: [compatPreset] }
export default { presets: ['babel-preset-compat'] }
For Babel config, you typically use the preset directly as a function or reference.
preset
module.exports = { presets: [ require('babel-preset-compat') ] }
module.exports = { presets: ['babel-preset-compat'] }
In CJS, require the module directly; string references may not work.

Demonstrates basic usage of the preset with custom targets for legacy browsers.

// Install: npm install --save-dev babel-preset-compat // Then in babel.config.js: module.exports = { presets: [ ['babel-preset-compat', { targets: { ie: '11', chrome: '49' } }] ] };
Debug
Known issues
gotchaNo README provided; configuration options are undocumented.
fix
Visit source code or use with caution; defaults may be unexpected.
affects: *
deprecatedPackage has not been updated in over 2 years; may not support modern syntax.
fix
Consider using @babel/preset-env with appropriate targets instead.
affects: *
breakingVersion 0.x has unstable API; breaking changes may occur between minor versions.
fix
Pin exact version and test thoroughly.
affects: >=0.22.0 <1.0.0
Errors
Common errors & fixes
Cannot find module 'babel-preset-compat'
Package not installed or not in node_modules.
fix
Run 'npm install --save-dev babel-preset-compat'.
Preset threw error: unknown option '...'
Invalid or unsupported option passed to preset.
fix
Refer to source code for valid options; typical options include 'targets'.
Upgrade
Version history
0.22.4latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources
babel-preset-compat — npm install babel-preset-compat · libregistry