{"id":22903555,"url":"https://github.com/sawyerbutton/angular-app-githubio","last_synced_at":"2025-04-01T07:24:09.158Z","repository":{"id":120747969,"uuid":"154237620","full_name":"sawyerbutton/angular-app-githubio","owner":"sawyerbutton","description":"Angular application based on github.io","archived":false,"fork":false,"pushed_at":"2018-10-23T09:02:27.000Z","size":194,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-07T04:41:15.555Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://sawyerbutton.github.io/angular-app-githubio/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sawyerbutton.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-23T00:50:28.000Z","updated_at":"2018-10-23T09:01:42.000Z","dependencies_parsed_at":"2023-07-07T23:05:59.632Z","dependency_job_id":null,"html_url":"https://github.com/sawyerbutton/angular-app-githubio","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sawyerbutton%2Fangular-app-githubio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sawyerbutton%2Fangular-app-githubio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sawyerbutton%2Fangular-app-githubio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sawyerbutton%2Fangular-app-githubio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sawyerbutton","download_url":"https://codeload.github.com/sawyerbutton/angular-app-githubio/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246599157,"owners_count":20803152,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-14T02:37:47.296Z","updated_at":"2025-04-01T07:24:09.153Z","avatar_url":"https://github.com/sawyerbutton.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AngularAppGithub.io\n\n## 如何在github.io上部署Angular web应用程序\n\n\u003e Github Pages 是 Github的一个强大功能,可以在其上免费托管静态网站或网络应用程序\n\n\u003e 使用方式也及其简单,只需要将文件放入`gh-pages`的分支中即可\n\n\u003e 而配合Angular CLI和node库[angular-cli-ghpages](https://github.com/angular-schule/angular-cli-ghpages)可以帮助你更快捷地将Angular app部署在Github pages中\n\n## 如何部署\n\n1. 在Angular app目录下安装`angular-cli-ghpages`\n\n```bash\nnpm i angular-cli-ghpages --save-dev\n```\n\n2. 在`package.json`文件中配置node可执行指令\n\n```json\n{\n\"scripts\": {\n    \"ng\": \"ng\",\n    \"start\": \"ng serve\",\n    \"build\": \"ng build\",\n    \"test\": \"ng test\",\n    \"lint\": \"ng lint\",\n    \"e2e\": \"ng e2e\",\n    \"deploy\": \"ng build --prod --base-href /angular-app-githubio/ \u0026\u0026 angular-cli-ghpages --dir ./dist/angular-app-githubio/\"\n  }\n }\n```\n\n3. 执行npm deploy指令\n\n```bash\nnpm run deploy\n```\n\n4. 打开浏览器输入 `https://\u003cusername\u003e.github.io/\u003crepo-name\u003e/`即可看到部署在Github pages上的Angular web应用程序\n\n## 值得注意的地方\n\n- 注意要确保托管在github上的repo名称和本地一致以避免命名不匹配冲突\n- 在使用Angular CLI 6 或更高版本时,打包后的文件将会在`dist`文件夹的以项目名称命名的子文件夹中,如存在此种状况需要对npx指令进行制定目录的部署如\n\n```bash\nnpx ngh --dir=dist/[PROJECTNAME]\n```\n\n- 在绝大多数情况下,`[PROJECTNAME]`能在`angular.json`文件中的`defaultProject`字段下找到\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsawyerbutton%2Fangular-app-githubio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsawyerbutton%2Fangular-app-githubio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsawyerbutton%2Fangular-app-githubio/lists"}