Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Bower build

Will Jones edited this page Aug 31, 2015 · 1 revision

How Bower dependencies are built

The Grunt plugin grunt-bower-concat is used to automate concatenation of bower dependencies. There are separate bower_concat tasks for dev and live-build. Both tasks will accept minified and unminified bower dependencies, but differ in priority:

  • bower_concat:dev will search for non-minified version first. If non are found it will include the minified versions.
  • bower_concat:build (production/live builds) will search for minified versions first. If non are found, it will include the non-minified versions.

Options/exceptions

The grunt-bower-concat module has various options available, which allow you to include/exclude bower packages, manually specify the "main" files if dependencies don't specify them (or don't have a bower.json file), or manually specify dependencies for a bower package.

Refer to the grunt-bower-concat documentation for available options.

Bower.json requirements for peer libraries

All peer dependencies are required to have at their built development and/or production (.min.) files listed in the main array of their bower.json config file.

Ex:

Files in the "example" project are built to:

dist/exmaple.js
dist/example.js-templates.js
dist/example.min.js
dist/exmaple.css
dist/exmaple.min.css

The main property of the "example" repo's bower.json file could look something like this:

...
"main": [
    "./dist/example-templates.js"
    "./dist/example.js"
    "./dist/example.css"
],
...