I'm using jade/pug template engine with ExpressJS on Node.js. It outputs a html with single line. No indentation at all. I couldn't find any beautifier option.

有帮助吗?

解决方案

There used to be a {pretty: true} option but it was removed because it messed up with whitespaces.

Refs:

https://github.com/visionmedia/jade/issues/#issue/91 https://github.com/visionmedia/jade/issues/closed/#issue/89

其他提示

In app.js, pass the pretty option to the Jade compiler.

app.set('view options', { pretty: true });

If you are compileing from console, then you can use this :

jade views/ --out html --pretty layout.jade

it will generate beutyfied code in html folder.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top