From a1e92a99aef951eedea8c43ef10e51d188d9f4b8 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Thu, 21 May 2015 20:12:13 +0100 Subject: [PATCH] fix(task): replace bower with bower-config This should dramatically reduce the package size. Requires manual testing. Fixes #62 --- package.json | 2 +- tasks/cdnify.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index a3303d6..f92eff3 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "proxyquire": "^1.3.0" }, "dependencies": { - "bower": ">=1.0.0", + "bower-config": "^0.6.1", "chalk": "^0.5.1", "google-cdn": "^1.0.0" }, diff --git a/tasks/cdnify.js b/tasks/cdnify.js index 65097c1..fb0d76f 100644 --- a/tasks/cdnify.js +++ b/tasks/cdnify.js @@ -3,7 +3,7 @@ var path = require('path'); var eachAsync = require('each-async'); var googlecdn = require('google-cdn'); -var bowerConfig = require('bower').config; +var bowerConfig = require('bower-config'); var chalk = require('chalk'); module.exports = function (grunt) { @@ -18,7 +18,8 @@ module.exports = function (grunt) { // Strip the leading path segment off, e.g. `app/bower_components` -> // `bower_components` - var bowerDirBits = bowerConfig.directory.split(path.sep); + var config = bowerConfig.create().load()._config; + var bowerDirBits = config.directory.split(path.sep); bowerDirBits.shift(); var componentsPath = bowerDirBits.join(path.sep);