tumbler.coffee, what is it?
tumbler.coffee is just a very simple static file server for CoffeeScript/Less development written in CoffeeScript.
To run it, you need to have:
- node.js installed (> 0.4)
- CoffeeScript installed in such a way, coffee is in your path. (typically via npm)
- If you want to use less as well, you need to have installed in such a way it is in your path as well. (typically via npm)
How to install
npm install tumbler -g
How to use?
Let's say you have the static files of your project in /my_project/static.
Go there, and run tumbler
All your static files (html, js, jpg, ...) are now available on [[http://localhost:10000/|localhost:10000]/<your relative path>].
But most importantly, if one queries for a something.js (respectively something.css) file, tumbler will look for something.coffee (respectively something.less) file and will serve the result of its compilation.
When the browser fetches filename.js, tumbler's response will differ depending on its mode:
tumbler serve -m debugAll the files will be included as script tag in the dom. This makes debugging easier as the
tumbler serve -m concatThe server will serve a big file, concatenation of all the other files.
tumbler serve -m releaseThe file are compressed and optimized using uglified js.
Tumbler is not intended for production use. You probably want to compile all your files before putting them on a performant static file server.
To do so, create a
project.targets file, you can then deploy by running
tumbler deploy -t project.targets -d destination -m release