欢迎光临
我们一直在努力

优化安装包大小脚本

建站超值云服务器,限时71元/月

优化安装包大小脚本

项目介绍:

AppThinning

Make app thinner.

详见 https://xiaozhuanlan.com/topic/3458629071

AppThinning

Features

  • Support jpg、png、jpeg、gif、svg.

  • Auto ignore compressed files.

  • Support imageOptim and tinyPng.

  • Support file size limit range.

Usage

  • Clone this repo

git clone git@github.com:CatchZeng/AppThinning.git
  • Check the node environment, if not installed, you can visit https://nodejs.org/ to download the installation package.

node -v
  • Install dependencies

npm i
  • Install imageOptim if you need use it to compress images.

  • Run script

node index.js -d "/Users/catchzeng/Desktop/test" -t "png|jpg" -s 1000 -m 2000 -c imageOptim
node index.js -h
Usage: index [options]

Options:
  -V, --version            output the version number
  -d, --dir <String>       project directory.
  -t, --types <String>     file types, default is jpg|png|jpeg|gif|svg.
  -s, --size <Number>      file size, the default is 100, 100 k
  -m, --maxSize<Number>    file max size, default is unlimited.
  -c, --compress <String>  compression types including imageOptim, tinyPng, default is imageOptim.
  -k, --key <String>       tinyPng key.
  -i, --ignore <String>    ignored files, default is read from ignore.txt. split by '|', such as a.png|/user/ss/b.png|c.png .
  -h, --help               output usage information

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 优化安装包大小脚本
分享到: 更多 (0)