I'm looking for simplest possible way to automatically recompile coffee scripts into JS.
Reading documentation but still having troubles to get exactly what I want.
I need it to watch folder src/
for any *.coffee
files modifications and compile them into concatenated javascript file into lib/something.js
.
Somehow can't combine watching, compiling and concatenating together. :/
Changed mind about concatenation.
Created small compiler.sh file which contains:
Kind a suits my needs.
try this one in root directory of the application
Well
coffee --watch
has 2 major flaws:git commit
itThe solution I came up with is a rather simple Bash script that takes
coffee --watch
a few steps further which will allow your working directory tree to be watched ever since system login, and automatically get compiled into JavaScript on each file save/change or new file creation:http://blog.gantrithor.com/post/11609373640/carefree-coffeescript-auto-compiler
There may be more elegant way to do this, but this implementation works great =)
find last modifed coffee script and put it in compile-watch mode
nodemon -x coffee server.coffee
does it for me.Install
nodemon
usingnpm install -g nodemon