vue-cli-plugin-prerender-multi-state
This plugin is based on vue-cli-plugin-prerender-spa but allows multiple initial Vuex states.
Install
vue add prerender-multi-state
Usage
Your Vuex store should follow following structure:
Vue Vuex
Configuration
This plugin will add a few entries to vue.config.js
Following example will generate folders dist/default
and dist/custom1
each with respective initial Vuex State
moduleexports = pluginOptions: prerenderMultiState: registry: undefined renderRoutes: '/' '/about' async { return default: state: hello: 'World' modules: module1: state: foo: 'bar' custom1: state: hello: 'World1' modules: module1: state: foo: 'bar1' }
states
(can return Promise) should return a States object respecting this Typescript Interface: