How to deploy Aurelia to GitHub Pages (gh-pages)

[亡魂溺海] 提交于 2019-12-04 12:06:09

问题


I haven't seen demos of Aurelia running in GitHub pages. I wonder if there's a gist or a repo somewhere that shows how it can be done.

Is it just a matter of configuring gulp or is there another solution?


回答1:


Here is the solution using the Aurelia navigation skeleton project as an example when created into your organization as a repository as aurelia-skeleton-navigation.

Important Note: This is NOT a production solution. This is for showing how to run Aurelia within GitHub pages using an Aurelia repository that uses Gulp. It is recommended to read about jspm bundling an Aurelia app for deployment.

Start a git command line after you unzip the current release of the skeleton-navigation into aurelia-skeleton-navigation directory.

Locally from a git and npm command line:

cd <path>/aurelia-skeleton-navigation

git init

git remote add origin git@github.com:yourorg/aurelia-skeleton-navigation.git

git fetch --all

git add *

git commit -m 'initial commit'

git push origin master

git branch gh-pages

git checkout gh-pages

edit .gitignore and comment out the jspm_packages and dist paths

node_modules
# jspm_packages
bower_components
.idea
.DS_STORE
# /dist

jspm install

npm install

gulp build

git add *

git commit -m 'adding resources'

git push origin gh-pages

Navigate to your repository GitHub page:
http://yourorg.github.io/aurelia-skeleton-navigation

Updating the app on GitHub Pages

Once you make changes to your app in the master branch, you can merge those changes into your gh-pages and publish:

  • git checkout gh-pages

  • git merge master

  • gulp build

  • git add *

  • git commit -m 'updates'

  • git push origin gh-pages



来源:https://stackoverflow.com/questions/29831885/how-to-deploy-aurelia-to-github-pages-gh-pages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!