/vuejs-gh-pages

Sample project to connect vue.js and deploy to github pages.

Primary LanguageVue

vuejs-gh-pages

Description


Sample Vue.js project which is deployed as Github Pages

View the application - [https://neographer.github.io/vuejs-gh-pages/]

Steps to create this project


1. Vue.js Boilerplate

npm install -g @vue/cli
vue new vuejs-gh-pages

2. Start the application

cd vuejs-gh-pages
npm install
npm run serve

3. Enable gh-pages

  • Install the npm package -- npm install gh-pages --save-dev

  • Create new vue.config.js and add the following code

    module.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"
    }

4. Build and Deploy

  • Build the application

    npm run build
  • Deploy the application

    npm run deploy

    or

    gh-pages -d dist