1.0.1 • Published 4 years ago

mini-app-zip-plugin v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

mini-app-zip-plugin

  • webpack 打包后直接生成 zip
  • 可以添加 app.json 等非打包文件进 zip
  • 打包后的结构,能直接上传 酷狗小程序开放平台

##安装

npm i mini-app-zip-plugin

##用法 在 webpack 的 plugin config 中使用

// in your webpack config
const miniAppZipPlugin = require('mini-app-zip-plugin');

plugins: [
    new miniAppZipPlugin(
        {
            r: [
                {
                  name: "test",
                  content: ["css/test.[hash].css", "js/common.[hash].js", "js/index.[hash].js", "js/test.[hash].js", "js/vendor.[hash].js", "index.html", "../app.json"]
                },
                {
                  name: "test2",
                  content: ["css/test2.[hash].css", "js/common2.[hash].js", "js/index2.[hash].js", "index.html", "../app2.json"]
                }
            ], 
            t: "../dist", 
            d: "../dist"
        }
    )
]

##参数说明

  • r: 打包规则,对象数组,有 n 个 打 n 个包
    • name: 打包后 zip 名称
    • content: 需要打包的内容,数组
  • t: 目标所在路径,content 中的所有内容路径相对与此路径
  • d: 打包完 zip 放置路径

##License MIT