How do you compile CoffeeScript in Jakefile?

I would like to create a Jakefile that compiles some CoffeeScripts to install a NodeJS application.

How do you do this?

I tried: https://gist.github.com/1241827

but this is a weak approach, definitely not cool.

Any clues?

+6
source share
1 answer

The approximate snippet I used is:

var fs = require('fs') var coffee = require('coffee-script') // If you'd like to see compiled code.. // console.log(coffee.compile(fs.readFileSync('coffee.coffee'))) // ..otherwise fs.writeFileSync('output.js', coffee.compile(fs.readFileSync('input.coffee'))) 

.. assumes you have the coffee-script node module installed.

Translation from this Cakefile of mine.

+3
source

Source: https://habr.com/ru/post/898043/


All Articles