publish-cocos-web
A tool to publish cocos web project to OSS
[TOC]
Installation
npm config set registry=https://registry.npm.taobao.org/
npm install publish-cocos-web
Usage
Init The Project
PreWork:
if there's no package.json file in your project,please run npm init
to create one.
npm install publish-cocos-web -D
install the tool
npx publish-cc init
- to create
.publish-cc.js
file
- edit the config file
.publish-cc.js
- [Important] add the filePath .publish-cc.js to .gitignore
- [Optional] add publish script task to package.json
package.json
{
"version":"1.0.1",
"name":"cocos-example",
"scripts":{
"publish":"publish-cc"
}
}
deploy
- edit the package.json's version
- npm run build
注: if no -v config is provided, publish-cc will use the package.json's version
npx publish-cc init
npx publish-cc --help
npx publish-cc
npx publish-cc -v v11
npm run publish
推荐使用说明
初始化
- 项目下面没有package.json的请执行
npm init
创建 - 安装 publish-cocos-web
npm install publish-cocos-web -D
- npx publish-cc init 首次创建.public-cc.js
- 将
.publish-cc.js
加入到.gitignore
文件中,防止秘钥被提交到git - 配置
.publish-cc.js
文件中的秘钥等字段 - pacakge.json文件增加publish脚本
{
"version":"1.0.0",
"scripts": {
"publish": "publish-cc"
},
}
使用
npm run publish
npx publish-cc
npx publish-cc -v v11
Config
- log.closeRecordFileUpload: do close the log for each upload file?
- cdnPath: the path for the oss