如何使用胡子的grunt htmlmin?

时间:2016-03-28 05:48:30

标签: mustache grunt-contrib-htmlmin

我正在使用带有胡子模板的grunt htmlmin,但是,似乎无法使用{{#mustache}}标记。例如,

<div class="m-icon {{^notLogin}}J_linkBtn" data-hash="#page=center"{{/notLogin}}{{#notLogin}}J_ShowLoginBox"{{/notLogin}}></div>

我得到了:

<div class="m-icon {{^notLogin}}J_linkBtn" data-hash="#page=center" notlogin notlogin j_showloginbox notlogin>"></div>

我尝试了this solution,并在Gruntfile中添加了这些行:

htmlmin: {                                    
  dist: {                                    
    options: {                               
      customAttrSurround: [
        [/\{\{(#|\^)[^}]+\}\}/, /\{\{\/[^}]+\}\}/]
      ]
    }
  }
}

但是我收到了一条错误消息:无法读取属性&to to ofLowerCase&#39;运行grunt时未定义的,在更改之前不会出现。

我该如何解决这个问题? THX。

0 个答案:

没有答案
相关问题