Registry / devops / build-workflow

build-workflow

JSON →
library7.0.1jsnpmunverified

A Gruntfile helper that breaks monolithic Gruntfiles into manageable modules. Current stable version is 7.0.1, with maintenance-level updates as needed. It organizes configs, custom tasks, and workflow aliases into separate files under 'grunt-deps/' and automatically loads them. Unlike alternatives like load-grunt-configs, it uses plain JavaScript (not YAML) for aliases and passes grunt/pkg objects to config functions. Primarily useful for legacy Grunt projects; the author recommends npm scripts for new projects.

npm install build-workflow
INSTALL
IMPORT
SIG · BUILD-WORKFLOW
B
build-workflow
devopsjavascriptv7.0.1
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

buildWorkflow
✓ const buildWorkflow = require('build-workflow');
✗ import buildWorkflow from 'build-workflow';
This package is CJS-only and does not provide ESM exports.
default
✓ require('build-workflow')(grunt);
✗ import buildWorkflow from 'build-workflow'; buildWorkflow(grunt);
The module exports a single function. Invoke it immediately with the grunt instance.
aliases
✓ // In grunt-deps/workflows/aliases.js: module.exports = function(grunt) { grunt.registerTask('default', ['task1']); };
✗ module.exports = { 'default': ['task1'] };
Alias files must export a function that registers tasks; plain objects are not supported.

Shows minimal setup: folder structure, Gruntfile, alias, custom task, and execution with grunt.

mkdir -p grunt-deps/configs grunt-deps/tasks grunt-deps/workflows cat > Gruntfile.js << 'EOF' module.exports = function(grunt) { 'use strict'; require('build-workflow')(grunt); }; EOF cat > grunt-deps/workflows/aliases.js << 'EOF' module.exports = function(grunt) { grunt.registerTask('default', ['hello']); }; EOF cat > grunt-deps/tasks/hello.js << 'EOF' module.exports = function(grunt) { grunt.registerTask('hello', function() { grunt.log.writeln('Hello from build-workflow!'); }); }; EOF npm init -y && npm install --save-dev grunt build-workflow grunt
Debug
Known issues
deprecatedPackage author recommends using npm scripts instead of Grunt for new projects.
fix
For new projects, use npm scripts (scripts in package.json) or a modern build tool like webpack/vite.
affects: *
gotchaConfig files must export a function that returns an object, not just an object. Otherwise configs won't load.
fix
Ensure every file in grunt-deps/configs exports a function: module.exports = function(grunt) { return { ... }; };
affects: *
gotchaAliases file must be in grunt-deps/workflows/aliases.js and export a function that registers tasks.
fix
Create the file with module.exports = function(grunt) { grunt.registerTask('default', [...]); };
affects: *
gotchaCustom tasks in grunt-deps/tasks are automatically loaded, but their filenames must match the task name.
fix
Name your files exactly as the task (e.g., hello.js for task 'hello').
affects: *
Errors
Common errors & fixes
Warning: Task "<task>" not found. Use --force to continue.
The task name in aliases or command line doesn't match any loaded task.
fix
Ensure the task file exists in grunt-deps/tasks or that the task is registered via grunt.registerTask.
TypeError: grunt.task.registerTask is not a function
Aliases.js exports an object instead of a function that receives grunt.
fix
Change module.exports = {...} to module.exports = function(grunt) { grunt.registerTask(...); };
Cannot find module 'grunt'
Grunt is not installed as a dev dependency.
fix
Run: npm install --save-dev grunt
Fatal error: Unable to find Gruntfile.js
Current directory doesn't contain a Gruntfile.js.
fix
Create a Gruntfile.js in the project root (see quickstart).
Upgrade
Version history
7.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
23 hits · last 30 days
node
22
OpenAI (training)
1
Resources
build-workflow — npm install build-workflow · libregistry