single-spa / single-spa-layout

Layout engine for single-spa applications
MIT License
78 stars 31 forks source link

Example of single-spa + vue + ssr #181

Closed jsedanoj closed 1 year ago

jsedanoj commented 2 years ago

Hello,

I have used the npx create-single-spa --moduleType root-config to create a root-config with spa-layout; then npx create-single-spa --moduleType app-parcel to create a few guest Vue3 applications (one for header, one for 404 and one for the content). So far, so good, appart for minor nuissance that I needed to add the libraryTarget=system in vue.config.js in the guests applications (I would have expected the cli to add it itself...). But well, appart from that, it is working.

But now I want to add SSR (mainly for SEO, so that for example curl http://localhost:9000/ returns the html of the home page with content). Do we have any example of such setup or a similar one? The closest I have found is https://github.com/isomorphic-microfrontends , referenced in the single-spa documentation https://single-spa.js.org/docs/examples but it does not seem to start from the structure generated by the cli but from a from-scratch one, or something like that.

Anybody doing something similar?

MilanKovacic commented 1 year ago

Closing due to age. Please reopen if the issue persists or there are new developments. Thanks!