1 min readJul 3, 2019
You could just install,
$ npm install -g vue-cli-ghpages
$ npm run build
$ sudo vue-cli-ghpages
the shorthand for this is,
$ sudo vcg
This way you will not need to create a gh-pages branch
But remember to on the master branch, in config/index.js change the build object (NOT to ‘dev’ object) property assetsPublicPath to,
assetsPublicPath: './',
or you can change it to,
assetsPublicPath: '/repo-name/dist/',
or to,
assetsPublicPath: 'https://user-name.github.io/repo-name',
Navigate to the repo’s gh-pages with,
https://user-name.github.io/repo-name/
Don’t forget the trailing forward slash at the end of this url.
To update the project,
$ git add .
$ git commit -m "updated commit"
$ git push origin master
$ npm run build
$ sudo vcg
Again navigate to,
https://user-name.github.io/repo-name
and a few hard refreshes may be necessary.
Also it may take a few moments for gh-pages to update.