浏览代码

处理生成配置文件空行问题

dygapp 4 年之前
父节点
当前提交
5d620632a3
共有 2 个文件被更改,包括 9 次插入4 次删除
  1. 4 4
      app/view/wan.nj
  2. 5 0
      config/config.default.js

+ 4 - 4
app/view/wan.nj

@@ -7,8 +7,8 @@ iface wan inet static
     gateway {{ gateway }}
     dns-nameservers {{ dns }}
 {% else %}
-    auto wan
-    iface wan inet dhcp
-        pre-up ifconfig eth0 up
-        dns-nameservers {{ dns }}
+auto wan
+iface wan inet dhcp
+    pre-up ifconfig eth0 up
+    dns-nameservers {{ dns }}
 {% endif %}

+ 5 - 0
config/config.default.js

@@ -48,6 +48,11 @@ module.exports = appInfo => {
       '.nj': 'nunjucks',
     },
   };
+  config.nunjucks = {
+    cache: false,
+    trimBlocks: true,
+    lstripBlocks: true,
+  };
   // 访问路径
   config.assets = {
     publicPath: '/public/',