Using Different Compilers

While roots' default template uses jade, stylus, and coffeescript, roots supports a large variety of different compiled languages that are extremely easy to get started with.

Roots uses a project called accord to compile files. In order to use a language, you just need to install the package using npm, then create a file using that language's file extension. Below is a list of supported languages along with their package names and extensions:

So for example if you wanted to use ejs, you could just run npm i ejs -S from your command line, then create a file with a .ejs extension, and the next time you run roots, it will compile.

If you want to pass options to any of these compilers, you can do so using app.coffee. Simple add the name of the compiler as a key to your configuration, and as the value, an object with any of the configuration values. Each language's options are documented here.

Note that multiple languages can be used with multipass compilation. This means that as long as the languages are compatible, you can put two extensions on a file and have it compiled through both languages. For example, if you wanted to run both jade and minify-html, you could name the file example.html.jade, install both compilers, set up the options as you wish, and it will run.