@wxa/plugin-minify-wxml

2.5.1 • Public • Published

@wxa/plugin-minify-wxml

用于压缩小程序wxml文件,避免由于代码中标签换行一起在真机显示时出现多余空格的问题

本插件是基于 html-minifier[https://github.com/kangax/html-minifier] 开发

插件配置与html-minifier保持一致,插件默认使用如下配置:

{
  caseSensitive: true,
  keepClosingSlash: true,
  collapseWhitespace: true,
  removeComments: true
}

使用方法

在项目中的wxa.config.js文件对应位置加入以下代码:

const MinifyWxmlPlugin = require('@wxa/plugin-minify-wxml');

plugins: [
    new MinifyWxmlPlugin()
    // new MinifyWxmlPlugin({自定义配置})
],

Readme

Keywords

Package Sidebar

Install

npm i @wxa/plugin-minify-wxml

Weekly Downloads

1

Version

2.5.1

License

MIT

Unpacked Size

4.11 kB

Total Files

5

Last publish

Collaborators

  • genuifx
  • zehuiguan
  • lucaszhu
  • fanniehuang
  • baoooooo