Windows预编译Handlebars.js模板 [英] Precompiling Handlebars.js templates in Windows

查看:137
本文介绍了Windows预编译Handlebars.js模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

查看用于预编译的 Handlebars.js 文档。



这些说明适用于OSX。如果是这样,当他们说安装节点和npm时,节点是指 node.js

解决方案


  1. 从这里安装Node.js for Windows: http://nodejs.org/download/

  2. 在命令行提示符下运行:

      npm install handlebars -g 


现在您可以在命令提示符:

  handlebars< input> -f<输出> 

,其中< input> 是原始模板文件名和< output> 是一个预先编译好的模板文件名。



/ p>


handlebars person.hbr -f person.js



Looking at the Handlebars.js documentation for precompilation.

The instructions are for OSX. Can this be done on Windows as well?

If so, when they say to "install node and npm" does "node" refer to "node.js"?

解决方案

  1. Install Node.js for Windows from here: http://nodejs.org/download/.
  2. Run in the command prompt:

    npm install handlebars -g
    

Now you can use the following syntax in the command prompt:

handlebars <input> -f <output>

,where <input> is an original template file name, and <output> is a pre-compliled template file name.

Example:

handlebars person.hbr -f person.js

这篇关于Windows预编译Handlebars.js模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆