Suppose we have a file named "master.coffee".
This will generate the following file:
But in many cases, we might want the name of the output file to be different than the name of the source file. I would like the --output flag to support this possibility. If the supplied path ends with a file rather than a folder, the Coffee compiler should use that name for the output file. Example:
CoffeeScript is the only "cutting edge" tool on the market that doesn't have the capability to specify complete output file paths. I know it may seem like a small thing, but when building CoffeeScript into other apps or tools, it really is a frustrating limitation. It's even more of an issue now that CS supports source maps, so we can't just change the file names on the fly; they're hard-coded into the maps.
Completely agreed. This is all fixed in redux.
Any idea when it's going to make its way into the shipping version?
You can always use the -s option to make the coffee command more UNIX-friendly:
coffee -cs <src/bla.coffee >lib/master.js
1) add a new option to specify file name
2) change current output to "ouput to file" if there's a dot in it ?
3) Promote -s
I'd vote for the second one.
I'd go with 0. do nothing; recommend use of -s option
-s is many times rather inconvenient (when running cli commands from other tools, for example), but I added it as 3).
2) What would happen when compiling multiple files?
3) Does it work with sourcemaps? Is it just being lazy?
-f --filename set the output file name
warn when passing multiple file names OR join by default
4) -j accepts a file name
@michaelficarra, well, yeah, i'd rather go with the same option of using stdin/stdout. I very much dislike all the bloat of having redundant options on UNIX-like commands. But given that the Coffee compiler already takes its input and output as file name arguments, i think that the second option mentioned by @Nami-Doc would be the best compromise.