← 全部工具

angular-cli-ghpages

热度 65 更新于 开发与构建

Deploy your Angular app to GitHub Pages or Cloudflare Pages directly from the Angular CLI (ng deploy)

npmauto-collected

安装

npm
npm install -g angular-cli-ghpages

通过 npm 安装。

angular-cli-ghpages

Deploy your Angular app to GitHub Pages, Cloudflare Pages or any other Git repo directly from the Angular CLI! 🚀

Table of contents:

  • 📖 Changelog
  • ⚠️ Prerequisites
  • 🚀 Quick Start
  • ⚙️ Installation
  • 🚀 Continuous Delivery
  • 📦 Deployment Options
  • --base-href
  • --build-target
  • --prerender-target
  • --no-build
  • --repo
  • --message
  • --branch
  • --name & --email
  • --no-dotfiles
  • --no-notfound
  • --no-nojekyll
  • --cname
  • --add
  • --dir
  • --dry-run
  • 📁 Configuration File
  • 🅰️ About

<hr

📖 Changelog <a name="changelog"</a

A detailed changelog is available in the releases section.

angular-cli-ghpages v3 supports Angular 18 to 22. For previous versions of Angular, use v1 or v2.

⚠️ Prerequisites <a name="prerequisites"</a

This command has the following prerequisites:

  • Git 1.9 or higher (execute git --version to check your version)
  • Angular project created via Angular CLI v18 or greater
  • Older Angular projects can still use a v1.x version or use the standalone program. See the documentation at READMEstandalone.

🚀 Quick Start <a name="quickstart"</a

angular-cli-ghpages compiles your app, then pushes the build output to a dedicated branch (default: gh-pages) – all with a single command: ng deploy. This branch serves as the source for your web host and works out of the box with GitHub Pages and Cloudflare Pages.

This quick start assumes that you are starting from scratch. If you already have an existing Angular project on GitHub, skip steps 1 and 2.

  • Install the latest version of the Angular CLI globally