Documentation for catch-all page
See original GitHub issueI’ve just setup a clean Vue 2 project with vue init
, and added prerender-spa-plugin
to my production webpack config like so:
new PrerenderSpaPlugin(
// Absolute path to compiled SPA
baseWebpackConfig.output.path,
// List of routes to prerender
[ '/' ]
),
And running $ npm run build
successfully build the Vue app, CSS & JS and indeed pre-renders the homepage. Excellent!
So next I added vue-router
, added a page & a route for /about
, and added that to my list of routes to prerender. $ npm run build
and dist/about/index.html
was created. Excellent!
What I don’t understand is what file I should point users to when I want to client-side render? For instance, I could pre-render the homepage and the about page, but if someone visits /login
and I want to client-side render the login page, which page in my dist/
folder should I fallback to?
For reference, my dist/
folder looks like:
dist/
about/index.html
static/...
index.html
I feel like I’m missing a page.html
that would be the non prerendered SPA HTML file that would be served for “all other routes”?
Thanks,
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (3 by maintainers)
Top GitHub Comments
@jdrydn - Excellent work!
If you want to add this to the documentation
README.md
in a PR, by all means 😉This is outside the responsibility of the plugin. When I’ve wanted this in the past, I just have Webpack create an extra copy of my HTML template as
fallback.html
or similar.