# ali-oss-deploy

> deploy the project to ali oss

Latest version **1.0.4** (published 2018-12-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install ali-oss-deploy
pnpm add ali-oss-deploy
yarn add ali-oss-deploy
bun add ali-oss-deploy
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2018-12-13 |
| First published | 2018-08-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | zhum |
| Maintainers | zhum |
| Keywords | ali-oss, deploy |

## Links

- npm: https://www.npmjs.com/package/ali-oss-deploy
- Repository: https://github.com/liuzhumin/ali-oss-deploy
- Homepage: https://github.com/liuzhumin/ali-oss-deploy#readme
- Issues: https://github.com/liuzhumin/ali-oss-deploy/issues
- npm.io page: https://npm.io/package/ali-oss-deploy

## Dependencies (2)

- [ali-oss](https://npm.io/package/ali-oss.md) ^6.0.1
- [aliyun-sdk](https://npm.io/package/aliyun-sdk.md) ^1.11.10

## Recent versions

- 1.0.4 (latest) — 2018-12-13
- 1.0.3 — 2018-08-29
- 1.0.2 — 2018-08-29
- 1.0.1 — 2018-08-29
- 1.0.0 — 2018-08-28

## README

### 部署静态资源到阿里云oss上，可根据发布模式选择不同的bucket，这里包括pro(正式)和test(测试)两种模式


### install
```
npm install ali-oss-deploy -S

```

### Add a deploy configuration file (deploy.js)
```
const deploy = require('ali-oss-deploy')

deploy({
    path: '../dist',   // 改为自己的静态资源目录
    ossConfig: {   // oss配置参数
        region: 'your region',
        accessKeyId: 'your accessKeyId',
        accessKeySecret: ' your accessKeySecret',
    },
    bucket: {
        pro: {
            name: 'your production bucket name',
            refreshPath: 'your refresh url', //可选，deploy后刷新缓存，必需保证url正确
        },
        test: {
            name: 'your test bucket name',
            projectPath: 'your project name', //可选，添加项目文件夹(需修改webpack的baseUrl,以保证资源文件路径正确)，不填默认为空
        },
    },
})

```

### Add a command line to package.json
```
"scripts": {

    "deploy": "node config/deploy.js pro",   // pro
    "deploy:test": "node config/deploy.js test",  //test

  },

```

### deploy - Command Line

```
npm run deploy    // mode-pro

npm run deploy:test    // mode-test

```

---
_Source: https://npm.io/package/ali-oss-deploy · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
