Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any thoughts on a command line compiler templates > compiles javascript? #13

Open
voidfiles opened this issue Mar 3, 2011 · 6 comments

Comments

@voidfiles
Copy link

I am looking at using DustJS as at templating library. I would really like to compile templates down to javascript from the command line, and then include them in by static asset build system.

Does anyone have an thoughts on how this could work?

@xonecas
Copy link

xonecas commented Mar 3, 2011

Yeah, the way I got that to work, is to use a pre start script that reads all of the templates and then compiles and writes them to a static .js file. To use from the command line, just use node.js cli.

@voidfiles
Copy link
Author

I didn't see a compile script is there one already?

@xonecas
Copy link

xonecas commented Mar 3, 2011

You'll have to write your own.

@voidfiles
Copy link
Author

Let us know if anyone is interested but we ended up creating a system for using compiled templates in production, but compiling them on demand in dev.

@copenhas
Copy link

Doesn't look like there has been any activity on this. I started playing around with dust.js a month ago or so and was using compiled templates both in CouchDB and served up as static javascript. For this I wrote a script to do it, but recently started trying to take my script to the "next level". It's on github, so anyone who may find it useful by all means. I have some plans for it to help me learn a bit more about the node landscape (vows.js specs, publish to npm, real CLI interface, better logging, the usual).

https://github.com/copenhas/broom

@deoxxa
Copy link

deoxxa commented Dec 20, 2011

I did the same thing as @copenhas with a slightly different approach, mine is just a simple utility to (recursively) compile a directory of templates. There's no configuration, and you can include it as a library to wrap your own interface around it (an express middleware has been one suggestion).

https://github.com/deoxxa/dusty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants