Reputation: 3677
I'm using coffeescript while writing a node js app and use cake watch to compile my js files real time.
That's great to be able to do that - but where should I stick those js files? Right now, I'm saving them right next to their respective coffeescript files, but that just feels awkward...
Upvotes: 1
Views: 209
Reputation: 16000
The convention I've gotten comfortable with is to put CoffeeScript files in a src
directory and have "compiled" JavaScript output to a lib
directory. Like so:
package.json
lib/mymodule.js
src/mymodule.coffee
If you publish the module to the npm registry, you can just include the resulting lib
directory, which is conventionally where projects written in JavaScript keep there .js
files. This keeps everything consistent.
Upvotes: 3