npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ng-deploy-oss

v19.0.0

Published

Deploy Angular apps to aliyun OSS, qiniu, upyun using the Angular CLI.

Downloads

152

Readme

ng-deploy-oss

npm CI The MIT License

使用 Angular CLI 发布 Angular 应用到阿里云 OSS、七牛云、又拍云 🚀

快速入门

1、安装 Angular CLI (v8.3.0 以上) 并创建一个新项目

npm install -g @angular/cli
ng new hello-world
cd hello-world

2、添加 ng-deploy-oss

ng add ng-deploy-oss

通用参数 以外,同时阿里云 OSS、七牛云、又拍云三种云存储,不同的类型需要的参数不同,更多细节请参考不同参数

3、部署

ng deploy

参数

通用参数

| 参数名 | 默认值 | 描述 | |-----|-----|----| | noBuild | false | 是否不执行构建命令 | | buildCommand | - | 自定义构建命令行 | | baseHref | - | 指定 baseHref 参数,赞同 ng build --base-href=xx 值 | | preClean | true | 是否预清除所有远程目录下的文件 | | oneByOneUpload | false | 是否逐个上传文件,并且将所有 html 放在最后上传 |

不同参数

阿里云 OSS

| 参数名 | 环境变量名 | 描述 | |-----|-------|----| | region | ALIOSS_REGION | OSS Region,完整列表请参考OSS 开通 Region 和 Endpoint 对照表 | | ak | ALIOSS_AK | 阿里云 AccessKeyId | | sk | ALIOSS_SK | 阿里云 AccessKeySecret | | stsToken | ALIOSS_STSTOKEN | 阿里云 STS Token | | bucket | ALIOSS_BUCKET | Bucket | | prefix | ALIOSS_PREFIX | 路径前缀,如果不指定表示放在根目录下 | | buildCommand | ALIOSS_BUILDCOMMAND | 构建生产环境的 NPM 命令行(例如:npm run build),若为空表示自动根据 angular.json 构建生成环境 |

七牛云

| 参数名 | 环境变量名 | 描述 | |-----|-------|----| | ak | QINIU_AK | 七牛云 AccessKey | | sk | QINIU_SK | 七牛云 SecretKey | | zone | QINIU_ZONE | 所在机房 | | bucket | QINIU_BUCKET | Bucket | | prefix | QINIU_PREFIX | 路径前缀,如果不指定表示放在根目录下 | | buildCommand | QINIU_BUILDCOMMAND | 构建生产环境的 NPM 命令行(例如:npm run build),若为空表示自动根据 angular.json 构建生成环境 |

又拍云

| 参数名 | 环境变量名 | 描述 | |-----|-------|----| | name | UPYUN_NAME | 服务名称 | | operatorName | UPYUN_OPERATORNAME | 操作员名称(确保可写入&可删除权限) | | operatorPwd | UPYUN_OPERATORPWD | 操作员密码 | | prefix | UPYUN_PREFIX | 路径前缀,如果不指定表示放在根目录下 | | buildCommand | UPYUN_BUILDCOMMAND | 构建生产环境的 NPM 命令行(例如:npm run build),若为空表示自动根据 angular.json 构建生成环境 |

使用环境变量

当运行 ng add ng-deploy-oss 时会根据所选的类型提示输入相应的参数,并把这些参数写入 angular.json 中。事实上,对于这些参数属于私密强的信息,这时候可以利用环境变量,来保护这些私密信息。

例如,当生产环境部署时,使用不同的 ALIOSS_AK 参数时:

# Windows:
set ALIOSS_AK=prod
# on OS X or Linux:
export ALIOSS_AK=prod

使用命令行

命令行参数也可以改变其参数值,但它的优先级会低于环境变量方式,高于 angular.json 配置的信息。

ng deploy --ak=prod

License

The MIT License (see the LICENSE file for the full text)