Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
236 views
in Technique[技术] by (71.8m points)

vue.js - Vue CLI for gh-pages issue

I used the next instructions to build and deploy vue application on GitHub Pages:

Publish on GitHub Pages

  1. Uncomment or delete /dist or dist/ folder from .gitignore files
  2. Create a new local branch and name it gh-pages (git branch gh-pages)
  3. Go to github and copy the name of the repository
  4. Create a new vue.config.js file in a root directory of the project
  5. In ‘vue.config.js’ file paste the following code:
/* vue.config.js */
module.exports = {
  publicPath: '/my-repo-name/'
}
  1. Run $ npm run build, and wait for it to finish.
  2. Add new files to git: git add . (with dot symbol)
  3. Commit new files: ```git commit -m "Initial dist subtree commit"``
  4. Upload the dist folder in the remote "gh-pages" branch: git subtree push --prefix dist origin gh-pages
  5. Navigate to your github repository in your browser and click "Settings" icon
  6. Scroll and find the section GitHub Pages. Select the "gh-pages" branch and click Save

The issue is next: vue.config.js file existed already on the main branch. I see that all links to files are broken and a lead to the root folder.

Link to the online demo: https://alexpilugin.github.io/ap-naked-wines/ Link to the repository: https://github.com/alexpilugin/ap-naked-wines

question from:https://stackoverflow.com/questions/65844462/vue-cli-for-gh-pages-issue

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...