Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

Pre Compiling Assets

Lakshan Perera edited this page Sep 11, 2012 · 6 revisions

It is painless to use compilable assets such as CoffeeScript and LESS in Punch. Every time you make a change, Punch will automatically re-compile them.

Similar to static assets(JavaScript and CSS), pre-compilable assets should also be placed within the templates directory. Then you can call them in the layouts, as you would call a static asset.

For example, if you have a LESS file in templates/assets/styles.less, you can simply call it as /assets/styles.css, to get the CSS output.

Check this screencast of editing a LESS file with Punch, to get a better idea of the development workflow:

Supporting other Pre-Compilers

Though, Punch supports CoffeeScript and LESS out of the box, it's really easy to add support to other pre-compilers. Refer the section on Adding Pre-Compilers for more details.