{"id":12894,"library":"bitcore-build","title":"Bitcore Build Helper","description":"The `bitcore-build` package serves as a specialized build helper within the larger Bitcore ecosystem by BitPay, providing pre-configured Gulp tasks for common development workflows. This utility streamlines processes such as linting, testing, and creating browser-compatible bundles for Bitcore modules, making it an essential component for developers contributing to or utilizing the Bitcore full stack for Bitcoin and blockchain-based applications. The current stable version, 10.10.5, aligns with the Bitcore monorepo's even-odd versioning convention, where even major versions denote stable releases. While Gulp is a foundational dependency, `bitcore-build` differentiates itself by offering a tailored, integrated build solution specifically designed for the Bitcore module architecture, rather than a general-purpose build tool. Its release cadence is tied to the overall Bitcore project, which sees continuous development and updates to its core libraries and services.","status":"maintenance","version":"10.10.5","language":"javascript","source_language":"en","source_url":"git://github.com/bitpay/bitcore-build","tags":["javascript","bitcore"],"install":[{"cmd":"npm install bitcore-build","lang":"bash","label":"npm"},{"cmd":"yarn add bitcore-build","lang":"bash","label":"yarn"},{"cmd":"pnpm add bitcore-build","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Bitcore-build is a Gulp-based task runner helper, requiring Gulp for its operations.","package":"gulp","optional":false}],"imports":[{"note":"This package is primarily designed for CommonJS environments, typically used within Gulpfiles. Direct ESM `import` syntax is not officially supported without a transpiler.","wrong":"import bitcoreTasks from 'bitcore-build';","symbol":"bitcoreTasks","correct":"const bitcoreTasks = require('bitcore-build');"},{"note":"The package exports a function that should be called with a module name string, not directly invoked without arguments.","wrong":"require('bitcore-build')();","symbol":"Gulp Integration","correct":"const gulp = require('gulp');\nconst bitcoreTasks = require('bitcore-build');\n\nbitcoreTasks('my-module');"},{"note":"To omit browser-specific tasks for Node.js-only modules, use the `skipBrowsers: true` option in the configuration object.","wrong":"bitcoreTasks('my-node-module', { browser: false });","symbol":"Browser Task Skipping","correct":"const bitcoreTasks = require('bitcore-build');\nbitcoreTasks('my-node-module', {skipBrowsers: true});"}],"quickstart":{"code":"const gulp = require('gulp');\nconst bitcoreTasks = require('bitcore-build');\n\n// Initialize bitcore-build for a module named 'my-custom-bitcore-module'\n// This will add default tasks like 'lint', 'test', 'browser', 'coverage' to Gulp.\nbitcoreTasks('my-custom-bitcore-module');\n\n// Define a default Gulp task to run common build steps.\n// The tasks 'lint', 'test', 'browser', 'coverage' are added by bitcore-build.\n// For Node.js-only modules, consider passing `{ skipBrowsers: true }` to `bitcoreTasks`.\ngulp.task('default', gulp.series('lint', 'test', 'browser', 'coverage', function(done) {\n  console.log('Bitcore module build complete!');\n  done();\n}));\n\n// Example of running a specific task added by bitcore-build:\ngulp.task('custom-test-run', gulp.series('test', function(done) {\n  console.log('Only tests were run!');\n  done();\n}));\n","lang":"javascript","description":"This quickstart demonstrates how to integrate `bitcore-build` into a Gulpfile, initialize it for a submodule, and define a default Gulp task to execute the common build, test, and coverage tasks provided by the package."},"warnings":[{"fix":"Refer to the `bitpay/bitcore` monorepo's `CHANGELOG.md` or release notes before upgrading, especially across major versions. Pin exact versions in `package.json` for production deployments.","message":"Bitcore's versioning scheme uses even major versions for stable releases (e.g., v8.x.x, v10.x.x) and odd major versions for beta releases (e.g., v9.x.x, v11.x.x). Beta versions may contain breaking changes or major feature additions that are still in testing. Always check the main Bitcore repository's release notes for specific version details.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"For new projects outside the direct Bitcore ecosystem, consider modern build tools. For existing Bitcore projects, continue using Gulp as prescribed.","message":"`bitcore-build` is heavily reliant on Gulp, which is an older build tool. Modern JavaScript projects often utilize more contemporary bundlers and task runners (e.g., Webpack, Rollup, Vite, or direct npm scripts). While still functional within the Bitcore ecosystem, external projects might find Gulp an outdated choice.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Pass `{ skipBrowsers: true }` as the second argument when calling `bitcoreTasks('your-module-name', { skipBrowsers: true });`","message":"When developing Node.js-only modules within the Bitcore ecosystem, ensure you explicitly skip browser-related build tasks to avoid unnecessary dependencies or build failures in non-browser environments.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Ensure `gulp` is installed locally in your project: `npm install --save-dev gulp` or `yarn add --dev gulp`.","cause":"`gulp` is a peer dependency or expected global install, and it's not found in the project's `node_modules` or globally.","error":"Error: Cannot find module 'gulp'"},{"fix":"Verify your `require` statement. The module is expected to export a function directly: `const bitcoreTasks = require('bitcore-build');`. Avoid `const { bitcoreTasks } = require('bitcore-build');` as it's a default export.","cause":"The `require('bitcore-build')` statement might be returning an unexpected value, or the module might not be correctly exporting its primary function.","error":"TypeError: bitcoreTasks is not a function"},{"fix":"Check if `bitcoreTasks('your-module', { skipBrowsers: true });` is used. If so, remove 'browser' from your `gulp.task` definition, or remove the `skipBrowsers` option if browser builds are intended.","cause":"This error occurs when `bitcore-build`'s browser tasks are not being loaded or are being explicitly skipped, but a Gulp task tries to run them.","error":"Task 'browser' is not in your gulpfile"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"bitcore-build"}