1介绍
压缩<template/>或<script type="template">。如:
<template>
压缩
</template>
=>
<template>压缩</template>
2配置
2.1conditions
- 类型:
array - 默认:
[{ tagName: 'template' }, { tagName: 'script', type: /template/ }] - 说明:指定匹配条件
 
2.2progress
- 类型:
string - 默认:
post-html - 说明:替换进度,详细参考前端构建工具中间件文档
 
2.3replacements
- 类型:
array - 默认:
[{ reg: /\s{2,}/g, replace: ' ' }, { reg: /[\n\r\t]/g, replace: '' }] - 说明:替换规则
 
3使用
// 在 coolie.config.js 中添加
coolie.use(require('coolie-mid-tag-template'), configs);