Fluffy
Fluffy

Reputation: 28362

Should I compile coffeescript files to js before using in production?

When deploying coffeescript code, is there any benefit to using coffee --compile, compiling it to js and then running with node, instead of using coffee directly?

Upvotes: 3

Views: 394

Answers (1)

hexacyanide
hexacyanide

Reputation: 91669

Both methods otherwise both compile into JavaScript files, unless you specify the --nodes flag, which parses the CoffeeScript rather than compiling it. In a production environment, you might not want the overhead of parsing and writing compiled JavaScript, but the difference isn't large.

It's up to you whether you want to compile before running on a production environment, but if you do, then the probability of getting errors could be lower.

The compile and write process source is here.

Upvotes: 1

Related Questions