Registry / devops / grunt-browserify

grunt-browserify

JSON →
library6.0.0jsnpmunverified

grunt-browserify is a Grunt task designed to integrate the popular `browserify` module bundler into Grunt-based JavaScript development workflows. It allows developers to write client-side JavaScript applications using the CommonJS module syntax, which is native to Node.js, and then bundle them for browser environments. The package's current stable version is 6.0.0, although the documentation and stated Grunt compatibility (`~0.4.0`) suggest it has not been actively maintained for modern Grunt (1.x) or Node.js versions (requires `8.10.x`). Its core utility lies in providing a convenient Grunt interface for Browserify's functionalities, including transformations and plugins, to manage JavaScript dependencies and create single-file bundles. This enables modular development on the client-side, promoting smaller, more reusable files and explicit dependency management, similar to the Node.js ecosystem. The project's release cadence appears to be very slow or halted, with the last major documentation updates reflecting features from earlier Browserify versions. Its key differentiation remains its direct integration within the Grunt build system for projects committed to that task runner, streamlining the bundling of CommonJS modules for the browser without requiring separate Browserify CLI commands.

npm install grunt-browserify
INSTALL
IMPORT
SIG · GRUNT-BROWSERIFY
G
grunt-browserify
devopsjavascriptv6.0.0
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.

Task Loading
grunt.loadNpmTasks('grunt-browserify');
import { browserify } from 'grunt-browserify';
Grunt tasks are loaded via `loadNpmTasks` within a `Gruntfile.js`, not via standard ES module imports or CommonJS `require()` for direct task execution.
Task Configuration
grunt.initConfig({ browserify: { // ... task options ... } });
import { configureBrowserify } from 'grunt-browserify'; configureBrowserify({ // ... });
Task-specific options for `grunt-browserify` are defined within the Grunt configuration object under the `browserify` key, following standard Grunt task configuration patterns.

Demonstrates installing the plugin, loading it in a Gruntfile, and a basic configuration to bundle a main JavaScript file into a distribution directory, including a common transform like babelify for modern JS.

npm install grunt-browserify --save-dev // Gruntfile.js module.exports = function(grunt) { grunt.initConfig({ browserify: { dist: { files: { './dist/app.js': ['./src/main.js'] }, options: { transform: [ ['babelify', { presets: ['@babel/preset-env'] }] ], // Example for a common browserifyOption (if needed for older versions of browserify itself) // browserifyOptions: { debug: true } } } } }); grunt.loadNpmTasks('grunt-browserify'); grunt.registerTask('default', ['browserify']); };
Debug
Known issues
breakingThe 3.0 release of `grunt-browserify` incorporated breaking changes from Browserify itself, which removed direct bundle options. All Browserify-specific options must now be passed within the `browserifyOptions` hash.
fix
Migrate all direct Browserify options (e.g., `debug`, `standalone`) into the `browserifyOptions` property within your Grunt task configuration: `{ options: { browserifyOptions: { /* ... */ } } }`.
affects: >=3.0
gotcha`grunt-browserify` officially requires Grunt `~0.4.0` and Node.js `>= 8.10.x`, which are very old versions. Using it with newer Grunt (e.g., 1.x) or Node.js versions may lead to compatibility issues or unexpected behavior.
fix
Ensure your project uses a compatible Grunt and Node.js version. If on a newer stack, consider migrating to a more actively maintained bundling solution or a modern Grunt plugin.
affects: All
gotchaThe project appears to be unmaintained, indicated by outdated documentation, old CI badges (`secure.travis-ci.org`), and very old dependency requirements. This can pose security risks and lack of support for modern JavaScript features or build tools.
fix
Evaluate the project's maintenance status regularly. For long-term projects, consider migrating to actively maintained alternatives for module bundling and task running to ensure security, performance, and compatibility.
affects: All
Errors
Common errors & fixes
Warning: Task 'browserify' not found.
The `grunt-browserify` plugin has not been loaded correctly in the Gruntfile, or it's not installed.
fix
Ensure `grunt-browserify` is installed via `npm install grunt-browserify --save-dev` and add `grunt.loadNpmTasks('grunt-browserify');` to your `Gruntfile.js`.
Error: Unknown option: [some_browserify_option_name] (e.g., 'debug', 'standalone')
Browserify-specific options are being passed directly to the `grunt-browserify` task configuration instead of being nested within the `browserifyOptions` hash, a breaking change introduced in v3.0.
fix
Move all Browserify-specific options into the `browserifyOptions` object within your Grunt task configuration, for example: `options: { browserifyOptions: { debug: true } }`.
Fatal error: Unable to find local grunt.
Grunt itself is not installed locally in the project, or the installed version is incompatible with the plugin.
fix
Run `npm install grunt --save-dev` to install Grunt locally. Verify that the Grunt version meets the `grunt-browserify` requirement of `~0.4.0`.
Upgrade
Version history
6.0.0latest on npm
Audit
Dependencies
gruntrequiredPeer dependency as a Grunt task runner plugin.
browserifyrequiredCore runtime dependency; this plugin is a wrapper around it.
Agent activity
4 hits · last 30 days
node
4
Resources
grunt-browserify — npm install grunt-browserify · libregistry