包详细信息

wxml-minifier

LeeJim9.2kMIT0.0.7

微信小程序WXML压缩工具

minifier, wxml, 微信小程序, miniprogram

自述文件

image

npm npm NPM coverage

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 移除所有的注释

更新日志

更新日志

0.0.7 2022-7-9

🐛 Bug Fixes

  • 修复属性的值为空字符串时,被省略的问题 @LeeJim #2

0.0.2 2022-1-9

🐛 Bug Fixes

  • 修复了 wxml 中存在自闭合 wxs 时报错的问题

0.0.1 2020-1-21

✨ Features

  • 移除多余空格
  • 移除注释