Has anyone managed to figure out how to make Vue.js work with history mode with GitHub or GitLab Pages?
It works with hash mode, but I don't want to use hash mode for SEO related reasons.
Reference for router modes: https://router.vuejs.org/en/essentials/history-mode.html
After you save the repository, it automatically creates a GitHub Page for you using the HTML at the root of the project. You can also set up GitHub Pages for any new or existing repositories you have on GitHub. In this post, we will create a Vue. js project and then deploy it to GitHub Pages.
Gitlab even created their own docs on how they use Vue.
2021 Answer
For those using GitLab there is now support to redirect to index.html using a _redirects file in your public folder.
Steps:
_redirects in the public folderSnippet:
/* /index.html 200
You can read up on it here: https://docs.gitlab.com/ee/user/project/pages/redirects.html#rewrite-all-requests-to-a-root-indexhtml
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With