wxml-minifier

0.0.7 • Public • Published

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

/wxml-minifier/

    Package Sidebar

    Install

    npm i wxml-minifier

    Weekly Downloads

    6,473

    Version

    0.0.7

    License

    MIT

    Unpacked Size

    162 kB

    Total Files

    26

    Last publish

    Collaborators

    • leejim