{"id":18165,"library":"bit-loader-builtins","title":"bit-loader-builtins","description":"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.","status":"maintenance","version":"2.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/MiguelCastillo/bit-loader-builtins","tags":["javascript","bit-bundler","bit-loader-plugin"],"install":[{"cmd":"npm install bit-loader-builtins","lang":"bash","label":"npm"},{"cmd":"yarn add bit-loader-builtins","lang":"bash","label":"yarn"},{"cmd":"pnpm add bit-loader-builtins","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Uses browserify's built-in module shims for Node.js polyfills","package":"browserify","optional":false}],"imports":[{"note":"The package exports a single function as default. ESM import is recommended for modern projects.","wrong":"const builtins = require('bit-loader-builtins')","symbol":"default","correct":"import builtins from 'bit-loader-builtins'"}],"quickstart":{"code":"import builtins from 'bit-loader-builtins';\nimport { Bundle } from 'bit-bundler';\n\nconst bundle = new Bundle();\nbundle.loader(builtins());\n// Now bundle can resolve 'fs', 'path', etc. and replace __dirname/__filename","lang":"javascript","description":"Creates a bit-bundler Bundle and registers the builtins plugin to handle Node.js built-ins and globals."},"warnings":[{"fix":"Test bundling of target modules thoroughly; avoid relying on unsupported builtins like 'cluster' or 'child_process'.","message":"The package relies on browserify's builtins which may not cover all Node.js modules or may have incomplete polyfills.","severity":"gotcha","affected_versions":"all"},{"fix":"Consider migrating to a modern bundler like Webpack, Rollup, or esbuild which have built-in Node.js polyfill support.","message":"bit-bundler itself is deprecated or no longer actively maintained, making this plugin of limited use.","severity":"deprecated","affected_versions":">=2.0.1"},{"fix":"Ensure bit-bundler is configured to handle the 'builtins' loader plugin correctly. Verify the bundle output for expected values.","message":"__dirname and __filename shimming may not work correctly in all scenarios if the module resolution is not properly set.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install bit-loader-builtins' and add 'bundle.loader(builtins())' to your bit-bundler setup.","cause":"bit-loader-builtins not registered with bit-bundler or not installed.","error":"Module not found: Can't resolve 'fs' in ..."},{"fix":"Use 'import builtins from 'bit-loader-builtins'' (ESM) or 'const builtins = require('bit-loader-builtins').default' (CJS).","cause":"Incorrect import: using default import but wrong syntax or missing default export.","error":"TypeError: builtins is not a function"},{"fix":"Double-check that bit-loader-builtins is installed and the loader is added to the bundle instance before bundling.","cause":"The builtins plugin is not applied or bit-bundler is not configured to use it.","error":"Cannot resolve module 'path'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}