Skip to content

Commit bdaf69b

Browse files
committed
Merge pull request #10 from bholloway/master
small fix to require() transform
2 parents ab32d81 + 17de724 commit bdaf69b

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

lib/build/browserify.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,9 @@ function compile(bannerWidth, transforms) {
137137

138138
// bower project
139139
} else {
140-
var directory = path.resolve(path.join(BOWER, path.dirname(original)));
141-
var isFound = fs.existsSync(directory) && fs.statSync(directory).isDirectory();
140+
var partial = path.dirname(original);
141+
var directory = (partial !== '.') && path.resolve(path.join(BOWER, partial));
142+
var isFound = directory && fs.existsSync(directory) && fs.statSync(directory).isDirectory();
142143
if (isFound) {
143144
transformed = slash(path.resolve(path.join(BOWER, original))); // path is within the bower directory
144145
}
@@ -197,7 +198,7 @@ function compile(bannerWidth, transforms) {
197198
return (new RegExp('[\'"]' + analysis[1] + '[\'"]')).test(fileText);
198199
})
199200
.shift();
200-
message = path.join(analysis[2], filename) + ':0:0: ' + analysis[1] + '\n';
201+
message = path.join(analysis[2], filename) + ':0:0: Cannot find import ' + analysis[1] + '\n';
201202

202203
// Unknown
203204
} else {

tasks/watch.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ gulp.task('watch', ['server'], function () {
1717
});
1818

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

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

35-
watch(streams.APP + '/**/*.html', {
36-
name : 'HTML',
37-
emitOnGlob: false
38-
}, queue.getHandler('html', 'reload'));
39-
4035
watch(streams.getGlob(['**/*.spec.js', '!*.spec.js']), {
4136
name : 'TEST',
4237
emitOnGlob: false

0 commit comments

Comments
 (0)