I used the next instructions to build and deploy vue application on GitHub Pages:
Publish on GitHub Pages
- Uncomment or delete
/dist
or dist/
folder from .gitignore files
- Create a new local branch and name it gh-pages (
git branch gh-pages
)
- Go to github and copy the name of the repository
- Create a new vue.config.js file in a root directory of the project
- In ‘vue.config.js’ file paste the following code:
/* vue.config.js */
module.exports = {
publicPath: '/my-repo-name/'
}
- Run
$ npm run build
, and wait for it to finish.
- Add new files to git:
git add .
(with dot symbol)
- Commit new files: ```git commit -m "Initial dist subtree commit"``
- Upload the dist folder in the remote "gh-pages" branch:
git subtree push --prefix dist origin gh-pages
- Navigate to your github repository in your browser and click "Settings" icon
- 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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…