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

Commit

Permalink
Merge pull request #364 from Financial-Times/build-fixes
Browse files Browse the repository at this point in the history
fix error when no JS or Sass streams are returned
  • Loading branch information
Alberto Elias committed Feb 23, 2016
2 parents c07366f + c608458 commit bcd029c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,18 @@ module.exports = function(gulp, config) {
const buildStream = merge();
const emitBuildStreamErrorEvent = buildStream.emit.bind(buildStream, 'error');
if (typeof config.watching === 'undefined' || config.watching === 'js') {
jsStream = module.exports.js(gulp, config)
.on('error', emitBuildStreamErrorEvent);
jsStream = module.exports.js(gulp, config);

if (typeof jsStream !== 'undefined') {
jsStream.on('error', emitBuildStreamErrorEvent);
}
}
if (typeof config.watching === 'undefined' || config.watching === 'sass') {
sassStream = module.exports.sass(gulp, config)
.on('error', emitBuildStreamErrorEvent);
sassStream = module.exports.sass(gulp, config);

if (typeof sassStream !== 'undefined') {
sassStream.on('error', emitBuildStreamErrorEvent);
}
}
if (jsStream && sassStream) {
buildStream.add(jsStream, sassStream);
Expand Down

0 comments on commit bcd029c

Please sign in to comment.