I'm new to using CoffeeScript and this is my first time trying it out. I have two questions.
- Compile to particular file
I want to compile a particular coffee file to javascript on the fly.
To do this, I've done the following:
coffee -w -o controllers/loginCtrl.js -c coffeescripts/loginCtrl.coffee
This gives me
ENOENT, open 'c:\path\to\public\testassets\js\controllers\loginCtrl.js\loginCtrl.js'
I believe this is happening because the js file already exists. If I remove the js file, the same command creates a folder called loginCtrl.js and then adds a file inside it.
How do I get coffeeScript to compile to a particular existing file or to a proper path?
- Remove unneeded code from compiled file
Assuming that the file gets compiled, the new js file gets compiled as
(function() {
....
}).call(this);
Is it possible for me to remove the first and last lines of this compiled code?