question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Documentation for catch-all page

See original GitHub issue

I’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:closed
  • Created 7 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
drewlustrocommented, Aug 11, 2017

@jdrydn - Excellent work!

If you want to add this to the documentation README.md in a PR, by all means 😉

1reaction
chrisvfritzcommented, Jan 19, 2017

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CatchAll - Documentation - catless
CatchAll extends SiteAction ... The default behaviour when a page does not exist. ... Check an etag to see if we need to...
Read more >
Catch-All Mobile Profile | Branch CMS Documentation
The Catch-All Mobile Profile is intended to be used to match mobile devices that either don't match another Mobile Profile or if no...
Read more >
CatchAll - LogRhythm Documentation
CatchAll · Vendor Documentation Link to Vendor Documentation · Classification Link to Classification · Mapping with LogRhythm Schema Link to Mapping with LogRhythm ......
Read more >
Dynamic Routes - Next.js
Dynamic Routes are pages that allow you to add custom params to your URLs. ... Dynamic routes can be extended to catch all...
Read more >
Document catch-all route · Issue #11769 - GitHub
Hi, for the purposes of our company app, I've had to do quite a lot of research regarding how to set up a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found