使用多个目标文件编译JADE

时间:2015-11-15 21:57:40

标签: javascript html node.js pug

我正在使用jade创建一些静态html文件:

jade index.jade --obj file1.json --out build/

这很好用。但是一旦我尝试输入另一个文件作为obj:

jade index.jade --obj file1.json, file2.json --out build/

jade index.jade --obj {file1,file2}.json --out build/

jade index.jade --obj file1.json --obj file2.json --out build/

它不再起作用了:

undefined:1
(./src/file1.json)
 ^

 SyntaxError: Unexpected token .
    at parseObj (/usr/lib/node_modules/jade/bin/jade.js:78:35)
    at Object.<anonymous> (/usr/lib/node_modules/jade/bin/jade.js:66:13)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Function.Module.runMain (module.js:457:10)
    at startup (node.js:136:18)
    at node.js:972:3

否则,当我尝试使用通配符时:

jade index.jade --obj *.json --out build/

只能在视图中呈现一个文件。

我在官方docs找不到任何信息。这么简单的问题:

如何在编译玉时包含多个JSON文件?

0 个答案:

没有答案