B
B
borisbg812021-08-01 14:10:59
Vue.js
borisbg81, 2021-08-01 14:10:59

Vue-cli: how to set prerendering of a multi-page site?

Good afternoon.
There is a task of creating a website using Vue and further deploying it on MODX.
I figured out how to create a multi-page site using vue-cli. When building the project, all pages are created normally.
The file structure is like this:

/src
   └─ /pages
        ├─ /index
        |    └─ app.js
        |    └─ App.vue
        ├─ /page1
        |    └─ app.js
        |    └─ App.vue
        ├─ /page2
        |    └─ app.js
        |    └─ App.vue

To deploy to MODX (with markup split into chunks and templates), you must have standard html markup. The question arose: how to generate standard html-files during assembly - with full markup.
SSR is not needed for this project.
A suitable option is prerendering with the prerender-spa-plugin or vue-prerender plugins. But only the index page is rendered, the rest are created as usual. According to information on various resources, it seems that prerendering does not support multi-page sites.
If you have encountered a similar situation, please tell me what are the options for generating html files with full markup.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question