开发者

Javascript template engine which would come with a precompilation script?

I am searching for the javascript template engine which ships with the precompilation script + watcher. How would I see it:

  1. You write the files as the typical html layouts and store in let's say the files of the .mustache type
  2. You run a watcher in the console, which watches the change开发者_如何学Pythons in the files and compiles them to .js files where the template is treated like a function, which performs the string concatenation and embeds the variables' values.
  3. This files are the used in the application.

This mechanism would solve a cross-domain issue in loading files of the non-js type, as well that it would be easy to merge them into one file for the performance reasons.

From the research I've made only the handlebars.js is promising to ship this feature in future. Would be happy to know if anyone else has implemented this?


You can try this solution for client javascript templates https://github.com/kupriyanenko/jsttojs


https://github.com/visionmedia/jade this takes about no time to learn and does everything you want.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜