I'm interested in using dust.js, and I'd want to prepile the templates for efficiency reasons.
To automate the pilation process, I'd like to be able to do this from the mand line. From the website, it seems that I'd have to use a browser to pile the templates. Is there a mand line solution?
I'm interested in using dust.js, and I'd want to prepile the templates for efficiency reasons.
To automate the pilation process, I'd like to be able to do this from the mand line. From the website, it seems that I'd have to use a browser to pile the templates. Is there a mand line solution?
Share Improve this question asked Jan 26, 2013 at 4:58 minouminou 16.6k21 gold badges74 silver badges118 bronze badges2 Answers
Reset to default 8There is a way to automate the pilation process using the mand line. First, you need to install dustjs-linkedin:
$ npm install -g dustjs-linkedin
Then you can use the mand dustc
:
$ dustc input_file.tl output_file.js
You can also specify a name for the template by using the --name
flag:
$ dustc --name=dust_fun dust_is_fun.tl dust_is_fun.js
For more info, take a look at the Dust by LinkedIn GitHub page.
dustc
has been pletely rewritten since version 2.6 of dustjs (however the syntax is almost identical), documentation is available here.
There are several mand line watchers that have been written to do this as well to automatically pile when a file changes. Here are a few:
- https://github./dmix/dusterjs
- https://github./mutualmobile/dust_piler
- https://github./jamsyoung/dust-piler
All these do is automate the dustc mand that smfoote has detailed.