0.0.26 • Published 5 years ago

sm-wepy-plugin-file-min v0.0.26

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

sm-wepy-plugin-file-min 插件

安装

npm install sm-wepy-plugin-file-min --save-dev

配置wepy.config.js

const FileMinPlugin = require('sm-wepy-plugin-file-min')

// 在末尾添加:
module.exports.plugins.push(FileMinPlugin())

// 关闭压缩功能:
module.exports.plugins.push(FileMinPlugin({ enable: false }))

或者根据你配置的环境变量来判断:

const isCompress = process.env.COMPRESS === 'compress';

if (isCompress) {
  module.exports.plugins.push(FileMinPlugin({}))
}

参数说明

你提供的配置选项 options 的 enable 字段 用于配置否关闭压缩功能。默认为开启

内部默认配置如下:

let options = {
  enable: true,
  wxml: true, 
  json: true,
  // 默认不压缩 wxss, 因为大部分开发者有用 less 或 sass 插件, 已经压缩过了 wxss。
  wxss: false
}
0.0.26

5 years ago

0.0.25

5 years ago

0.0.24

5 years ago

0.0.22

5 years ago

0.0.21

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago