Skip to content
This repository has been archived by the owner on Mar 14, 2022. It is now read-only.

Commit

Permalink
Use the 'cwd' config key if it exists, if not set to 'process.cwd()'
Browse files Browse the repository at this point in the history
  • Loading branch information
samgiles committed Jul 8, 2015
1 parent 7122594 commit b3b3dd8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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';
Expand All @@ -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'
Expand Down

0 comments on commit b3b3dd8

Please sign in to comment.