How to use blackcoffee with grunt watch

41 views Asked by At

I was hoping that grunt-contrib-coffee could work with blackcoffee but it seems that it uses the coffee-script npm module directly instead of calling the coffee executable which would have invoked blackcoffee. I have looked around to see if there are any pre-existing Grunt plugins for blackcoffee but this doesn't seem to be the case.

Any recommendations as to how to go about configuring Grunt so that grunt watch will let me compile my blackcoffee code?

1

There are 1 answers

0
hereandnow78 On

don't know if that works, but i think it should:

  1. fork grunt-contrib-coffee
  2. rename it in your package.json to grunt-blackcoffee
  3. replace coffee-script dependency, and replace with blackcoffee in your package.json
  4. search for the coffee-script require in the grunt task, currently it's here:

    return require('coffee-script').compile(code, coffeeOptions);
    

    and replace it with

    return require('blackcoffee').compile(code, coffeeOptions);
    
  5. publish it to npm

if you don't want to publish to npm, you can install packages from git:

$ npm install git+ssh://your-git-repo.git --save