debugging - 在 Jade 源中打开换行符?

标签 debugging node.js express pug

有没有办法打开换行符?这在调试时会很有用。

我知道这个主题 ( Node.js JADE linebreaks in source? ) 由于性能原因说不,但是在您的本地机器上开发时,这应该不是问题。

最佳答案

经过一番搜索,我找到了解决方案。将此添加到您的 Express 配置中,它将使 Jade 整理输出:

Express 3.x CoffeeScript

app.configure "development", ->
  app.use express.errorHandler()
  app.locals.pretty = true

Express 3.x Javascript

app.configure('development', function(){
  app.use(express.errorHandler());
  app.locals.pretty = true;
});

Express 2.x CoffeeScript

app.configure "development", ->
  app.use express.errorHandler()
  app.set "view options",
    pretty: true

Express 2.x Javascript

app.configure('development', function(){
  app.use(express.errorHandler());
  app.set('view options', { pretty: true });
});

关于debugging - 在 Jade 源中打开换行符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7416455/

相关文章:

javascript - 从 Google Apps 脚本调试客户端代码

node.js - Node 在IIS中找不到模块,可以从提示符中找到

reactjs - 服务器渲染的 React ExpressJS 前端泄露用户的 Redux 存储数据

c++ - 当我调试方法 AttachThreadInput() 时,Visual Studio 2010 挂起

python - 从异常对象中提取回溯信息

node.js - 入口点未定义 = index.html 使用 HtmlWebpackPlugin

node.js - ExpressJS : How to redirect a POST request with parameters

javascript - NodeJS - 错误 : The specified procedure could not be found. bcrypt_lib.node

debugging - 如何在没有 Google Chrome 的情况下使用 WebStorm JavaScript Debug 配置?

javascript - 将数据从 Javascript 文件发送到后端 Node.js