Skip to content
This repository has been archived by the owner on May 25, 2019. It is now read-only.

Commit

Permalink
fix(bower): allow bower.json customization
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasduteil committed Feb 5, 2014
1 parent ec4721a commit 14ee698
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 5 additions & 1 deletion Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ gulp.task('clean', function(done) {
});

gulp.task('build_gh-pages', build.ghpages);
gulp.task('build_bower', build.bower);

gulp.task('build_bower', function(done){
build.bower(done, cm.public.bowerData);
});

gulp.task('build_subbower', function(done){
var moduleNames = Object.keys(cm.public.subcomponents);
var almostDone = cm._.after(moduleNames.length, done);
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,10 @@ This config object can content the following key:
sub_dist_dir : String,
// directory used to store the sub component sources in the './dist' directory (ex: 'sub')


bowerData : {
// Bower data to overwrite.
// (ex: { name: 'my-component', main: './my-component.js' })
}

subcomponents : { // Collection of sub component
"<sub component name>" : {
Expand Down
4 changes: 2 additions & 2 deletions lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var DIR = cm.BUILD_DIR;

module.exports = {

bower: function (done) {
bower: function (done, bwrData) {

var almostDone = cm._.after(5, done);

Expand All @@ -18,7 +18,7 @@ module.exports = {
.on('end', almostDone);

gulp.src('./branch/bower/bower.tmpl.json')
.pipe(cm.processTemplateFile())
.pipe(cm.processTemplateFile({ bwr : cm._.assign({}, cm.bwr, bwrData) }))
.pipe(rename({ext: '.json'}))
.pipe(gulp.dest(DIR + '/bower/'))
.on('end', almostDone);
Expand Down

0 comments on commit 14ee698

Please sign in to comment.