Vite: Multi-page mode example

Created on 25 May 2020  路  6Comments  路  Source: vitejs/vite

Is your feature request related to a problem? Please describe.
I'm trying to get Vue3 + Vite working in multi-page mode.

Describe the solution you'd like
An example of how to use vite to build a multi-paged app, much like the pages option in the Vue CLI Config Reference.

Describe alternatives you've considered
I tried looking through the source to see if I could spot how this could be accomplished, but didn't find anything obvious I could try.

Additional context
I'm investigating using Vue3 + Vite to replace an existing Nuxt SSR solution, but perhaps the best answer here is to wait until things develop further to see which solutions emerge.

enhancement

Most helpful comment

Regardless of SSR, multi-page is something Vite does plan to support.

All 6 comments

SSR feels like PHP again... generating content e.g. head tag information on the server site...

If it is a multi page static site (not sure about SSR), from what I know,..

  • state can only be passed between pages through query strings or fragments or localStorage
  • each page will have its own vue object (so each page can be an SPA)

Regardless of SSR, multi-page is something Vite does plan to support.

There is a simple demo by @posva here of vue with vue-router, but that doesn't handle generation of all entry points. i.e /about works in dev, but not with generated bundle. Will be great to see proper support mentioned by @yyx990803

Is there any update on this?

Also interested if there's an update. Thanks.

Is there any update on this?

+1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

duanxianze picture duanxianze  路  3Comments

ashubham picture ashubham  路  3Comments

cmwhited picture cmwhited  路  3Comments

haikyuu picture haikyuu  路  3Comments

tbgse picture tbgse  路  4Comments