【发布时间】:2014-02-23 02:49:04
【问题描述】:
我想缩小我的 .html 文件。我尝试使用grunt-contrib-htmlmin、grunt-processhtml 进行缩小。他们实际上无法缩小。然后我意识到我所有的 html 元素都包含在jQuery.tmpl 中。这些缩小工具似乎没有触及脚本标签。所以我有一堆模板看起来像这样:
<script id='wrapper' type='text/x-jquery-tmpl'>
<div class='person-wrapper'>
{{html $item.html()}}
</div>
<!-- many html tags -->
</script>
我的问题是如何缩小 (jQuery.tmpl) 模板?我正在使用 Gruntjs 来缩小 .css、.js 文件。但是任何工具或插件都会受到赞赏。
【问题讨论】:
标签: javascript html templates gruntjs minify