From b3b3dd899778b45b5666881a868535a9b3b29e80 Mon Sep 17 00:00:00 2001 From: SamGiles Date: Wed, 8 Jul 2015 12:36:38 +0100 Subject: [PATCH] Use the 'cwd' config key if it exists, if not set to 'process.cwd()' --- lib/tasks/build.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/tasks/build.js b/lib/tasks/build.js index 27f1e874..3da63ad9 100644 --- a/lib/tasks/build.js +++ b/lib/tasks/build.js @@ -40,10 +40,11 @@ module.exports = function(gulp, config) { module.exports.js = function(gulp, config) { config = config || {}; var src = config.js || files.getMainJsPath() || null; + var cwd = config.cwd || process.cwd(); if (src) { // See; https://github.com/substack/node-browserify#btransformtr-opts - var transforms = [babelify, { transform: debowerify, options: { bowerOptions: { cwd:config.cwd, relative: true }}}, textrequireify.create({ - rootDirectory: config.cwd || process.cwd() + var transforms = [babelify, { transform: debowerify, options: { bowerOptions: { cwd: cwd, relative: true }}}, textrequireify.create({ + rootDirectory: cwd })].concat(config.transforms || []); config.env = config.env || 'development'; @@ -96,6 +97,7 @@ module.exports.sass = function(gulp, config) { config = config || {}; var src = config.sass || files.getMainSassPath() || null; var cwd = config.cwd || process.cwd(); + if (src) { var destFolder = config.buildFolder || files.getBuildFolderPath(); var dest = config.buildCss || 'main.css'; @@ -105,6 +107,7 @@ module.exports.sass = function(gulp, config) { config.env = config.env || 'development'; var useSourceMaps = config.sourcemaps === true || config.env === 'development'; + console.log("Current working directory: ", cwd); var sassConfig = { includePaths: [path.join(cwd, 'bower_components')].concat(config.sassIncludePaths || []), outputStyle: config.env === 'production' ? 'compressed' : 'nested'