Sample Vue.js project which is deployed as Github Pages
View the application - [https://neographer.github.io/vuejs-gh-pages/]
npm install -g @vue/cli
vue new vuejs-gh-pages
cd vuejs-gh-pages
npm install
npm run serve
-
Install the npm package --
npm install gh-pages --save-dev
-
Create new
vue.config.js
and add the following codemodule.exports = { publicPath: process.env.NODE_ENV === "production" ? "/vuejs-gh-pages/" : "/", };
Where
"/vuejs-gh-pages/"
is the name of the repository. -
Update the scripts section with following line
"scripts": { "deploy": "gh-pages -d dist" }
-
Build the application
npm run build
-
Deploy the application
npm run deploy
or
gh-pages -d dist