-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strange bug with bare option #2
Comments
Interesting. Will look at this when I have a minute. |
Additionally, when you use |
After some tests, the bug seems happening when giving multiple files by glob. gulp.src( [ "src/**/*.litcoffee" ] )
.pipe( coffee( options ) )
.on( "error", gutil.log )
.pipe gulp.dest "bin" -> generates bugs and undeclared variables gulp.src( [ "src/models/dicecheck.litcoffee" ] )
.pipe( coffee( options ) )
.on( "error", gutil.log )
.pipe gulp.dest "bin" -> generate proper compiled file I have absolutely no idea how to debug this (I still haven't much experience with gulp), but this is really anoying... :( |
I've found it ! When you send multiple files, the I will make a pull request this afternoon. |
Which options? Also, does the litcoffee stuff work fine without telling the coffee compiler specifically that it is litcoffee? |
Hmm maybe we should infer that from the file extension instead of explicity passing in |
When you don't give |
I can confirm this bug for config Using the class example in http://coffeescript.org/#classes The compiled js gets borked: https://github.com/Dashed/gulp-coffee-sandbox/blob/master/src/subdir/a.js The global vars seems to be missing. |
I'm currently writing a fix, I will make the pull request soon. |
Et voilà ! 290f1fc |
Fantastic, I just tested your PR on my sandbox. Works perfectly. |
You're welcome. I hope it will be merged & published on npm soon, to fix the issues in my work-project builds... :) |
@leny You may want to add more default options into your PR as listed here: https://github.com/gruntjs/grunt-contrib-coffee/blob/master/tasks/coffee.js#L17 |
@dashed done. Thanks. |
👍 great work guys! |
@Jenius it's patched in 1.2.5 and is available on npm. =] if it works as your side, and there are no outstanding problems, then please close this ticket |
Looks good - thanks guys! |
This is super weird, and I'm not totally sure it's gulp-coffee's fault, but hear me out on this one.
Gulp task, compiles coffeescript. I add in the
{ bare: true }
option, assuming all will go well since I'm compiling node anyway. When they come out, the coffeescript extension__extends
is not getting compiled at the top of files that use classes (this is breaking and causes all files with classes to immediately throw an error).Get rid of the bare option and it's back, albeit with an extra useless function wrapper now. Looks like a bug in coffeescript to me, really. Make sure locally installed coffeescript is the same version as the one required by gulp-coffee (1.6.3, yep, but you guys should be using
1.x.x
in your package.json, because semver), compile the file manually with the bare option.__extends
is defined in the files, and no function wrapper, everything works perfectly. Wat?So I checked the source and it looks like you guys are just compiling through
coffee-script
, as usual, but I figured I'd at least log this here because compiling with coffee manually didn't break anything, but the compilation through gulp caused breakage.Any thoughts or help on this appreciated!
The text was updated successfully, but these errors were encountered: