nbugs-ship-cdn
ship web assets to the CDN mirror server
Usage
建议 nbugs-ship-cdn
用于与 package.json
文件相同目录下执行,因为它会读出 package.json
文件的 name
和 version
作为参数。
将单个文件发布到 CDN 源站:
nbugs-ship-cdn public/index.js
将多个文件发布到 CDN 源站:
nbugs-ship-cdn "public/**"
手动设置参数:
nbugs-ship-cdn "**/*" --name nbugs --version 1.0.0 --force
通过 node 模块编写自定义脚本:
const shipCDN = ; // 设置发布选项const options = // 服务端接口地址 url: "http://cdn.xiaoyuanhao.com" // 项目名称 name: "nbugs" // 项目版本 version: "1.0.0" // 用于签名验证,可以是任意字符串 key: "use to sign" // any thing // 是否可以覆盖 force: false // overwrite flag // 单个文件发送前的回调函数 {} // 单个文件的发布回调函数 {} // ship 单个文件; // 使用数组 ship 多个文件; // 使用 glob 语法 ship 多文件shipCDN; // ship 回调shipCDN;