Registry / devops / bit-loader-builtins

bit-loader-builtins

JSON →
library2.0.2jsnpmunverified

A loader plugin for bit-bundler that resolves Node.js built-in modules (like 'fs', 'path', 'http') and provides browser-compatible shims using browserify's builtins. Version 2.0.2 is the latest stable release, though the project appears to be in maintenance mode with no recent updates. Key differentiator: it seamlessly integrates with bit-bundler to handle Node.js globals (__dirname, __filename) and built-in modules during browser bundling, leveraging browserify's established polyfills.

npm install bit-loader-builtins
INSTALL
IMPORT
SIG · BIT-LOADER-BUILTIN
B
bit-loader-builtins
devopsjavascriptv2.0.2
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 builtins from 'bit-loader-builtins'
const builtins = require('bit-loader-builtins')
The package exports a single function as default. ESM import is recommended for modern projects.

Creates a bit-bundler Bundle and registers the builtins plugin to handle Node.js built-ins and globals.

import builtins from 'bit-loader-builtins'; import { Bundle } from 'bit-bundler'; const bundle = new Bundle(); bundle.loader(builtins()); // Now bundle can resolve 'fs', 'path', etc. and replace __dirname/__filename
Debug
Known issues
gotchaThe package relies on browserify's builtins which may not cover all Node.js modules or may have incomplete polyfills.
fix
Test bundling of target modules thoroughly; avoid relying on unsupported builtins like 'cluster' or 'child_process'.
affects: all
deprecatedbit-bundler itself is deprecated or no longer actively maintained, making this plugin of limited use.
fix
Consider migrating to a modern bundler like Webpack, Rollup, or esbuild which have built-in Node.js polyfill support.
affects: >=2.0.1
gotcha__dirname and __filename shimming may not work correctly in all scenarios if the module resolution is not properly set.
fix
Ensure bit-bundler is configured to handle the 'builtins' loader plugin correctly. Verify the bundle output for expected values.
affects: all
Errors
Common errors & fixes
Module not found: Can't resolve 'fs' in ...
bit-loader-builtins not registered with bit-bundler or not installed.
fix
Run 'npm install bit-loader-builtins' and add 'bundle.loader(builtins())' to your bit-bundler setup.
TypeError: builtins is not a function
Incorrect import: using default import but wrong syntax or missing default export.
fix
Use 'import builtins from 'bit-loader-builtins'' (ESM) or 'const builtins = require('bit-loader-builtins').default' (CJS).
Cannot resolve module 'path'
The builtins plugin is not applied or bit-bundler is not configured to use it.
fix
Double-check that bit-loader-builtins is installed and the loader is added to the bundle instance before bundling.
Upgrade
Version history
2.0.2latest on npm
Audit
Dependencies
browserifyrequiredUses browserify's built-in module shims for Node.js polyfills
Agent activity
3 hits · last 30 days
node
2
Resources
bit-loader-builtins — npm install bit-loader-builtins · libregistry