Usage

Vapper requires Vue to be version 2.6+

Integrated into the Vue CLI 3/4 project

Here is a simple and working example: vapper-vue-cli-example.

  1. Create a project using the vue create command:
yarn global add @vue/cli
vue create my-vapper-app

If you already have a project created with Vue CLI, you can skip this step.

  1. Install @vapper/core
yarn add @vapper/core vue-router

vue-router must be installed and used in the Vapper project. If you have already installed vue-router when creating the project, you can ignore it.

  1. add npm scripts
{
  "scripts": {
    "dev": "vapper dev",
    "build": "vapper build",
    "start": "vapper start"
  }
}
  1. Modify the entry file:

Finally, you need to modify your entry file as required by SSR: entry file document

Integrated into the Poi project

Here is a simple and working example: vapper-poi-example.

  1. Create a project with create-poi-app:
yarn global add create-poi-app
create-poi-app my-vapper-app

If you already have a Poi project, you can skip this step.

  1. Installation dependence:
yarn add @vapper/core @vapper/configer-poi vue vue-router vue-template-compiler -D
  1. Modify vapper.config.js:
module.exports = {
  entry: 'src/index.js'
}

Because vapper's default entry file is src/main.js, and Poi's default entry file is src/index.js.

  1. add npm scripts
{
  "scripts": {
    "dev": "vapper dev",
    "build": "vapper build",
    "start": "vapper start"
  }
}
  1. Modify the entry file:

Finally, you need to modify your entry file as required by SSR: entry file document