sstephenson / eco

Embedded CoffeeScript templates
MIT License
1.71k stars 70 forks source link

Is it possible to run eco in the browser? #2

Closed benjaminjackman closed 13 years ago

benjaminjackman commented 14 years ago

It seems like the code in lib is designed to run within node.js on the server side.

sstephenson commented 14 years ago

Yes, compiled Eco templates will run in the browser — no problem. They're just plain JavaScript functions.

The Eco compiler itself runs in the browser in the latest HEAD. You can see it in action here: http://sstephenson.github.com/eco/ (You need to load the CoffeeScript compiler, too, which is quite hefty. The current version is 230 KB.)

To build the browser version of Eco, run cake dist. You'll need the closure-compiler module from npm. The generated file will be saved in dist/eco.js.

I'll leave this open for a bit in case you have any other questions. This will all be documented in the next release.

sstephenson commented 13 years ago

Closing the ticket. Feel free to reopen if you need more clarification.

joshgoebel commented 13 years ago

Did this ever get documented anywhere?