0.0.7 • Published 3 years ago
wxml-minifier v0.0.7
wxml-minifier
微信小程序 WXML 压缩工具
安装
npm i -D wxml-minifier
使用
minifier(resource, options)
基础使用
const minifier = require('wxml-minifier')
const wxmlStr = `
<view class="home" >
<!-- test -->
</view>
`
const minified = minifier(wxmlStr)
console.log(minified) // <view class="home></view>
选项
名称 | 类型 | 默认值 | 功能 |
---|---|---|---|
whitespace | Boolean | true | 移除 wxml 多余的空格 |
comment | Boolean | true | 移除所有的注释 |