加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angular – 如何发布到github页面?

发布时间:2020-12-17 17:46:55 所属栏目:安全 来源:网络整理
导读:我无法理解有关发布到 github页面的一些基本指令.有一种新方法可以发布使用Angular Cli制作的Angular项目;我按照新命令angular-cli-ghpages从 this page开始的指示: Execute angular-cli-ghpages in order to deploy the project with a build from dist fo
我无法理解有关发布到 github页面的一些基本指令.有一种新方法可以发布使用Angular Cli制作的Angular项目;我按照新命令angular-cli-ghpages从 this page开始的指示:

Execute angular-cli-ghpages in order to deploy the project with a build from dist folder.
Note: you have to create the dist folder in before (e.g. ng build --prod)

Usage:

ng build --prod --base-href "https://USERNAME.github.io/REPOSITORY/"
angular-cli-ghpages [OPTIONS]

我为我的项目创建了一个dist文件夹,然后运行ng构建代码.终端显示已渲染的所有块,但我找不到github页面的链接.我在github上查看我的存储库,就好像什么也没发生过一样.这是因为我需要cd到一个特定的文件夹来执行angular-cli-ghpages吗?这是我的repo,我非常感谢任何帮助.

解决方法

我成功地使用命令推送到github页面

angular-cli-ghpages --repo=https://github.com/parthghiya/testrepo.git --name=parthghiya --email=parth.ghiya@knowarth.com --no-silent

回购链接:https://github.com/parthghiya/testrepo

我做了构建–prod –base href.

我做的步骤:

>生成我的SSH&添加它.

https://help.github.com/articles/connecting-to-github-with-ssh/

>执行了push命令.

enter image description here

编辑:

添加多个文件夹

创建与资产平行的文件夹,我创建了2个文件夹Parth& Ghiya.然后在angular-cli.json中添加以下条目

"assets": [
        "assets","parth","ghiya","favicon.ico","manifest.json"
      ],

所以dist文件夹现在包含3个文件夹,现在资产,parth& ghiya.然后执行上面的push命令.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读