@starxqqqq/h5-package
v1.5.2-1
Published
h5离线打包工具
Downloads
2
Readme
h5-package
h5-package是一个从mpackage-cli基础上扩展的hybrid app H5离线资源包的打包工具。
可以生成离线资源包和离线资源的清单文件。
h5-package需要从项目配置文件package.json读取以下属性,这些属性在上传到服务器解析时需要
name 项目英文名称,因要作为目录使用,不要用特殊字符
title 项目中文名称
version 构建版本
versionCode 构建版本号,纯数字
entryFile 项目入口文件,一般为html文件路径
description 项目描述
host h5服务器选择列表
inject 打包时注入html的js或css文件
安装/卸载
全局安装/卸载
yarn global add http://gitlab.hztianque.com/tq-appcloud-dev/web/h5-package.git
yarn global remove h5-package
本地安装/卸载
yarn add http://gitlab.hztianque.com/tq-appcloud-dev/web/h5-package.git -D
yarn remove h5-package
全局安装用法
# 帮助
h5-package -h
# 查看版本
h5-package --version
# 打包
h5-package build <src>
# 指定打包存放目录,默认package
h5-package build <src> --dist|-d [dist]
# 打包时注入tq-h5container.min.js
h5-package build <src> --tqh5container|-t [tqh5container]
本地安装用法
# 帮助
node node_modules/h5-package -h
# 查看版本
node node_modules/h5-package --version
# 打包
node h5-package build <src>
# 指定打包存放目录,默认package
node h5-package build <src> --dist|-d [dist]
# 打包时注入tq-h5container.min.js
node h5-package build <src> --tqh5container|-t [tqh5container]
package.json 格式示例
{
"name": "collection",
"title": "全科采集",
"version": "1.0.91",
"versionCode": "1091",
"entryFile": "h5/index.html",
"description": "A Vue.js project",
"host":{
"hz": "172.17.229.227:21100",
"wz": "192.168.1.148:21100",
"tz": "192.168.1.178:21400",
"jx": "59.202.29.209:21100",
"jd": "182.140.240.104:21100"
},
"inject":{
"js":["aa.js"],
"css":["aa.css"]
},
...
}
pkg.json 格式示例
{
"protocol": ["http", "https"],
"package": "collection",
"title": "全科采集",
"version": "1.0.104",
"versionCode": "10104",
"entryFile": "h5/index.html",
"description": "A Vue.js project",
"host": "182.140.240.104:21100",
"rules": [{
"path": "/collection/h5/index.html",
"file": "collection/h5/index.html"
}, {
"path": "/collection/h5/static/assets/banner.6550a83.png",
"file": "collection/h5/static/assets/banner.6550a83.png"
}, {
"path": "/collection/h5/static/assets/bg_org.25b12fb.png",
"file": "collection/h5/static/assets/bg_org.25b12fb.png"
}, {
"path": "/collection/h5/static/map/manifest.json",
"file": "collection/h5/static/map/manifest.json"
}, {
"path": "/collection/h5/static/map/map.html",
"file": "collection/h5/static/map/map.html"
}, {
"path": "/collection/tq-h5container.min.js",
"file": "collection/tq-h5container.min.js"
}]
}