Registry / web-framework / babel-preset-fbjs

babel-preset-fbjs

JSON →
library3.4.0jsnpmunverified

Babel preset for Facebook projects, version 3.4.0, stable. It includes transforms for modern JavaScript, Flow, and JSX (React), with options for auto-import, inline requires, module rewriting, and DEV stripping. Differentiators: official Facebook tooling for internal consistency, customizable via configure API, but tightly coupled to Facebook's ecosystem. Release cadence is infrequent.

npm install babel-preset-fbjs
INSTALL
IMPORT
SIG · BABEL-PRESET-FBJS
B
babel-preset-fbjs
web-frameworkjavascriptv3.4.0
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
module.exports = require('babel-preset-fbjs'); // or in .babelrc: 'fbjs'
import preset from 'babel-preset-fbjs'; // ESM not supported
This is a CommonJS module; use require() or string reference in .babelrc.
configure
const configure = require('babel-preset-fbjs/configure');
import configure from 'babel-preset-fbjs/configure'; // ESM not supported
Access the configure function from the subpath 'babel-preset-fbjs/configure'.
plugins
const {plugins} = require('babel-preset-fbjs/plugins');
const {plugins} = require('babel-preset-fbjs').plugins; // incorrect path
Plugins are exported from 'babel-preset-fbjs/plugins'.

Transpile JavaScript code using babel-preset-fbjs preset via the Babel API.

const babel = require('@babel/core'); const code = `const x = 1;`; babel.transformSync(code, { presets: ['babel-preset-fbjs'] });
Debug
Known issues
gotchaThis preset is designed for Facebook's internal projects. It may not be suitable general-purpose use.
fix
Consider using @babel/preset-env for standard projects.
affects: >=3.0
deprecatedSome transforms like stripDEV only work with specific Babel versions.
fix
Check Babel core compatibility.
affects: >=3.0
gotchaInline requires option is experimental and may cause runtime issues.
fix
Avoid using inlineRequires: true in production.
affects: >=3.0
gotchaES module import of babel-preset-fbjs fails; it lacks ESM wrapper.
fix
Use CommonJS require() instead of ESM import.
affects: >=3.0
Errors
Common errors & fixes
Cannot find module 'babel-preset-fbjs/configure'
Incorrect path; missing subpath export or used wrong casing.
fix
Use require('babel-preset-fbjs/configure') exactly.
Error: Plugin/Preset files are not allowed to export objects, only functions.
Passed preset object directly instead of string or function.
fix
Use preset as string: presets: ['babel-preset-fbjs']
Upgrade
Version history
3.4.0latest on npm
Audit
Dependencies
@babel/corerequiredpeer dependency. Required for Babel transform pipeline.
Agent activity
12 hits · last 30 days
node
10
OpenAI (training)
1
Resources
babel-preset-fbjs — npm install babel-preset-fbjs · libregistry