Skip to content

Commit

Permalink
Merge pull request angularity#10 from bholloway/master
Browse files Browse the repository at this point in the history
small fix to require() transform
  • Loading branch information
bholloway committed Jan 28, 2015
2 parents ab32d81 + 17de724 commit bdaf69b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
7 changes: 4 additions & 3 deletions lib/build/browserify.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,9 @@ function compile(bannerWidth, transforms) {

// bower project
} else {
var directory = path.resolve(path.join(BOWER, path.dirname(original)));
var isFound = fs.existsSync(directory) && fs.statSync(directory).isDirectory();
var partial = path.dirname(original);
var directory = (partial !== '.') && path.resolve(path.join(BOWER, partial));
var isFound = directory && fs.existsSync(directory) && fs.statSync(directory).isDirectory();
if (isFound) {
transformed = slash(path.resolve(path.join(BOWER, original))); // path is within the bower directory
}
Expand Down Expand Up @@ -197,7 +198,7 @@ function compile(bannerWidth, transforms) {
return (new RegExp('[\'"]' + analysis[1] + '[\'"]')).test(fileText);
})
.shift();
message = path.join(analysis[2], filename) + ':0:0: ' + analysis[1] + '\n';
message = path.join(analysis[2], filename) + ':0:0: Cannot find import ' + analysis[1] + '\n';

// Unknown
} else {
Expand Down
11 changes: 3 additions & 8 deletions tasks/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ gulp.task('watch', ['server'], function () {
});

// watch statements
watch(streams.getGlob(['**/*.js', '!*.js', '!**/*.spec.js'], [streams.APP, streams.NODE, streams.BOWER]), {
name : 'JS',
watch(streams.getGlob(['**/*.js', '**/*.html', '!*.*', '!**/*.spec.*'], [streams.APP, streams.NODE, streams.BOWER]), {
name : 'JS|HTML',
emitOnGlob: false
}, queue.getHandler('js', 'html', 'reload')); // html will be needed in case previous injection failed
}, queue.getHandler('js', 'html', 'reload')); // app html will be needed in case previous injection failed

watch(streams.getGlob(['**/*.scss', '!*.scss'], [streams.APP, streams.NODE, streams.BOWER]), {
name : 'CSS',
Expand All @@ -32,11 +32,6 @@ gulp.task('watch', ['server'], function () {
emitOnGlob: false
}, queue.getHandler('html', 'reload'));

watch(streams.APP + '/**/*.html', {
name : 'HTML',
emitOnGlob: false
}, queue.getHandler('html', 'reload'));

watch(streams.getGlob(['**/*.spec.js', '!*.spec.js']), {
name : 'TEST',
emitOnGlob: false
Expand Down

0 comments on commit bdaf69b

Please sign in to comment.