Registry / devops / grunt-bower-concat

grunt-bower-concat

JSON →
library1.0.0jsnpmunverified

Grunt plugin that automatically concatenates installed Bower components (JS and CSS) in the correct dependency order. Version 1.0.0 is the latest stable release, compatible with Grunt 0.4+. It resolves ordering based on Bower dependencies and allows manual overrides via dependencies, mainFiles, and callback options. Differentiates from general concatenation tools by targeting Bower-managed frontend dependencies, supporting multiple output file types (js, css, scss, coffee), and offering per-component file processing. Development appears to have stalled with no recent updates, and Bower itself is deprecated in favor of npm/yarn.

npm install grunt-bower-concat
INSTALL
IMPORT
SIG · GRUNT-BOWER-CONCAT
G
grunt-bower-concat
devopsjavascriptv1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

bower_concat
grunt.loadNpmTasks('grunt-bower-concat');
npm install grunt-bower-concat --save-dev
The npm install is a prereq; the loadNpmTasks call is required in Gruntfile to register the task.
bower_concat task config
bower_concat: { all: { dest: { js: 'build/_bower.js', css: 'build/_bower.css' } } }
bower_concat: { all: { dest: 'build/_bower.js' } }
The dest option can be a string (deprecated) or an object with filetype keys. Object form is recommended.
Task invocation
grunt.registerTask('default', ['bower_concat']);
grunt bower_concat
The command line usage is 'grunt bower_concat', but in a Gruntfile you register it in a task list.

Configures grunt-bower-concat to concatenate all installed Bower components (excluding jquery) into build/_bower.js and build/_bower.css, with manual dependency declaration for underscore.

// Install: npm install grunt-bower-concat --save-dev // In Gruntfile.js: module.exports = function(grunt) { grunt.initConfig({ bower_concat: { all: { dest: { js: 'build/_bower.js', css: 'build/_bower.css' }, exclude: ['jquery'], dependencies: { 'underscore': 'jquery' } } } }); grunt.loadNpmTasks('grunt-bower-concat'); grunt.registerTask('default', ['bower_concat']); };
Debug
Known issues
deprecatedBower is deprecated; new projects should use npm/yarn. grunt-bower-concat will no longer receive updates.
fix
Migrate to npm-based asset management and use tools like webpack-concat or grunt-concat.
affects: >=1.0.0
gotchaThe 'dest' option as a string (for JS only) is deprecated; use object form with filetype keys.
fix
Use dest: { js: 'path/to/output.js', css: 'path/to/output.css' }
affects: >=1.0.0
gotchaIf components lack bower.json or main files, the plugin may guess incorrectly. Use 'mainFiles' option to override.
fix
Add mainFiles: { 'component-name': 'path/to/main.js' } in config.
affects: >=0.8
gotchaComponent order may be incorrect if dependencies are not declared in bower.json. Use 'dependencies' option to fix ordering.
fix
Specify dependencies manually: dependencies: { 'mygallery': ['jquery', 'fotorama'] }
affects: >=0.1
breakingVersion 0.3.0 changed the default separator from '' to grunt.util.linefeed, which can break minification if not followed by semicolon.
fix
Set options: { separator: ';' } for JavaScript concatenation.
affects: >=0.3 <1.0.0
gotchaThe 'bowerOptions' option requires Bower to be installed globally or locally; missing Bower will cause failures.
fix
Ensure Bower is installed: npm install -g bower or as a devDependency.
affects: >=0.5
Errors
Common errors & fixes
Warning: Task "bower_concat" not found.
Missing grunt.loadNpmTasks('grunt-bower-concat') or plugin not installed.
fix
Run 'npm install grunt-bower-concat --save-dev' and add 'grunt.loadNpmTasks('grunt-bower-concat')' to Gruntfile.
Fatal error: Unable to read bower.json file for component [name].
Component lacks a bower.json file, or file is malformed.
fix
Use 'mainFiles' option to manually specify main files for that component.
Warning: No Bower components found.
No bower_components directory or bower.json not processed.
fix
Run 'bower install' first, and ensure bower.json lists dependencies with 'bower install --save'.
Destination not written, src files were empty.
No components included (all excluded or none present).
fix
Check 'include'/'exclude' options and verify components are installed.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
gruntrequiredpeer dependency; required to run as a Grunt plugin
Agent activity
4 hits · last 30 days
node
4
Resources
grunt-bower-concat — npm install grunt-bower-concat · libregistry