Created
January 14, 2014 20:00
-
-
Save spikebrehm/8424636 to your computer and use it in GitHub Desktop.
Why is hbsfy not working? Where the heck does this error come from?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp') | |
, browserify = require('gulp-browserify') | |
; | |
gulp.task('scripts', function() { | |
return gulp.src('./js/sample.js') | |
.pipe(browserify({ | |
debug: true, | |
transform: ['hbsfy'], | |
})) | |
.pipe(gulp.dest('./build/')); | |
}); | |
gulp.task('default', function() { | |
gulp.run('scripts'); | |
gulp.watch('./js/**/*.js', function() { | |
gulp.run('scripts'); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ gulp | |
[gulp] Using file /Users/spike/code/onechrome/gulpfile.js | |
[gulp] Working directory changed to /Users/spike/code/onechrome | |
[gulp] Running 'default'... | |
[gulp] Running 'scripts'... | |
[gulp] Finished 'default' in 10 ms | |
/Users/spike/code/onechrome/js/sample.js | |
stream.js:94 | |
throw er; // Unhandled stream error in pipe. | |
^ | |
SyntaxError: Unexpected identifier |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var templates = {}; | |
templates.offices = require('./templates/offices.hbs'); | |
console.log(templates); |
Yeah, I am sure as it matures error handling will improve.
Here is an early snapshot that I had working: https://gist.github.com/alanpeabody/7021d903961a3c9eab6e
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@alanpeabody thanks for the suggestions. If I make the require relative to the entry point, I actually get a useful stacktrace:
I wish Gulp didn't swallow the error and provided a better backtrace!