Registry / devops / babel-bits

babel-bits

JSON →
library1.0.1jsnpmunverified

babel-bits is an npm package designed to integrate Babel 6 transformations within the bit-imports and bit-bundler ecosystems. It acts as a handler for JavaScript files, allowing them to be transpiled during the import or bundling process. The package, currently at its last stable version v1.0.1 released in 2017, wraps `babel-core` (v6) along with `babel-preset-es2015` and `babel-preset-react` as default configurations. The project and its parent `bit-imports` and `bit-bundler` dependencies appear to be abandoned, with no significant updates or maintenance since 2017. Key differentiators included its deep integration with the specific module loading and bundling mechanisms of `bit-imports` and `bit-bundler`, offering a pre-configured, albeit outdated, Babel setup for those systems. It does not follow a regular release cadence and is effectively end-of-life.

npm install babel-bits
INSTALL
IMPORT
SIG · BABEL-BITS
B
babel-bits
devopsjavascriptv1.0.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.

babel-bits handler string
bitimports.plugin("js", { transform: { handler: "babel-bits", options: { /* ... */ } } });
import { handler } from 'babel-bits'; /* Not exposed for direct import */
babel-bits is designed to be loaded by bit-imports as a handler string, not directly imported in user code via ES Modules or CommonJS `require()` statements.
Options for Babel
bitimports.plugin("js", { transform: { handler: "babel-bits", options: { sourceMaps: "inline", presets: ["es2015", "react"] } } });
import { configure } from 'babel-bits';
Babel options are passed directly through the `options` property within the `bit-imports` plugin configuration object.

Demonstrates how to configure `babel-bits` as a transformation handler within `bit-imports`, enabling Babel 6 transpilation for loaded JavaScript files.

const bitimports = require('bit-imports'); // Configure bit-imports to use babel-bits for JavaScript transformations bitimports.plugin('js', { transform: { handler: 'babel-bits', // Specify babel-bits as the transformation handler options: { sourceMaps: 'inline', // Enable inline source maps for debugging presets: ['es2015', 'react'] // Configure default Babel 6 presets } } }); // Example of how bit-imports might then load a module // In a real application, you would load your main application file here // const myModule = bitimports.load('./src/main.js'); // console.log('bit-imports configured with babel-bits:', myModule); console.log('babel-bits is configured via bit-imports plugin. No direct module interaction typically occurs.'); console.log('Ensure babel-core, babel-preset-es2015, and babel-preset-react are installed alongside.');
Debug
Known issues
breakingbabel-bits relies exclusively on Babel 6 (specifically `babel-core@^6.0.0`) and its associated presets. It is fundamentally incompatible with Babel 7+ due to significant API changes and package renames. Attempting to use it with a modern Babel setup will lead to errors.
fix
Downgrade your Babel setup to Babel 6 if you must use babel-bits, or migrate away from babel-bits and the bit-imports/bit-bundler ecosystem to a modern bundler like Webpack or Rollup with Babel 7+.
affects: >=1.0.0
deprecatedThe entire babel-bits, bit-imports, and bit-bundler ecosystem is considered abandoned. There have been no code updates or maintenance since 2017. Using this package in new projects is strongly discouraged, and existing projects should plan for migration.
fix
Migrate your project to a currently maintained module bundler (e.g., Webpack, Rollup, Vite) and a modern Babel setup (Babel 7+).
affects: >=0.1.0
gotchaWhen using Babel 6 (as babel-bits does) for generator functions (e.g., `async/await`), you must manually include `regeneratorRuntime` in your application's global scope. Babel 6 does not automatically polyfill this, leading to runtime errors.
fix
Load the `regenerator-runtime` package (e.g., `require('regenerator-runtime/runtime')` or include via a script tag) at the entry point of your application before any transpiled generator code executes.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module '@babel/core' or similar errors referencing new Babel packages.
babel-bits expects Babel 6 packages (e.g., `babel-core`), not Babel 7+ packages (e.g., `@babel/core`).
fix
Ensure `babel-core`, `babel-preset-es2015`, and `babel-preset-react` (all `^6.0.0`) are installed as direct dependencies. Do NOT install `@babel/core` or other `@babel/` scoped packages.
ReferenceError: regeneratorRuntime is not defined
Babel 6 transforms generator functions (like `async/await`) into code that requires `regeneratorRuntime` to be available globally, but `babel-bits` does not automatically provide this polyfill.
fix
Install `regenerator-runtime` (`npm install regenerator-runtime`) and import it once at the top of your application's entry file: `require('regenerator-runtime/runtime');` or ensure it's loaded via a script tag in the browser.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies
babel-corerequiredCore Babel 6 transpiler.
babel-preset-es2015requiredDefault preset for ES2015 features.
babel-preset-reactrequiredDefault preset for React JSX syntax.
Agent activity
16 hits · last 30 days
node
12
Amazon
1
OpenAI (training)
1
Resources
babel-bits — npm install babel-bits · libregistry