当前位置: 动力学知识库 > 问答 > 编程问答 >

pug - How do I set a basedir in Jade using command line

问题描述:

Is there a way to set 'basedir' option in jade command line? Or, maybe, another way to use absolute pathing there. Thanks.

网友答案:

Jade has, among other options, the following

-O, --obj <str|path> JavaScript options object or JSON file containing it

So you could write something like this:

jade -O "{basedir:'/home/charlie/Git/ElfSite/Code'}" temp.jade

Or you could create a file called options.json that looked something like this:

{ "basedir": "/home/charlie/Git/ElfSite/Code", "title": "My Title" }

And then call jade like this:

jade -O options.json temp.jade

Or like this:

jade --obj options.json temp.jade

分享给朋友:
您可能感兴趣的文章:
随机阅读: