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-builtinsVerified import paths — ran on the pinned version, not inferred.
Creates a bit-bundler Bundle and registers the builtins plugin to handle Node.js built-ins and globals.
Test bundling of target modules thoroughly; avoid relying on unsupported builtins like 'cluster' or 'child_process'.
Consider migrating to a modern bundler like Webpack, Rollup, or esbuild which have built-in Node.js polyfill support.
Ensure bit-bundler is configured to handle the 'builtins' loader plugin correctly. Verify the bundle output for expected values.
Run 'npm install bit-loader-builtins' and add 'bundle.loader(builtins())' to your bit-bundler setup.
Use 'import builtins from 'bit-loader-builtins'' (ESM) or 'const builtins = require('bit-loader-builtins').default' (CJS).Double-check that bit-loader-builtins is installed and the loader is added to the bundle instance before bundling.