Prerender-spa-plugin pre-rendered page display problem, using vue

because the pre-rendering plug-in prerender-spa-plugin, which is labor-saving and easy to configure, is selected to optimize seo,

the configuration is like this

    new PrerenderSpaPlugin({
      staticDir: path.resolve(__dirname, "../dist"),
      routes: [ "/"],
      server: {
        port: 8080
      },
      renderer: new Renderer({
        // Optional - Wait to render until the specified element is detected using `document.querySelector`
        renderAfterElementExists: "-sharpgames-area",
        headless: true // Display the browser window when rendering. Useful for debugging.
      })
    })

but the static html div-sharpapp from build contains all the static resources I want to get. Although I achieve the purpose of rendering,
, when I enter from other pages (for example, enter host/about directly in the URL column), I will flash the layout and style of the home page first

router mode is risking the use of hash (avoid trouble QQ), wants to know if there is a way to solve this problem without changing router mode

has anyone ever encountered this problem with the pre-rendering plug-in?

Feb.13,2022

routes: [ '/']

add the route you want to pre-render


add the page route you want to render to the route


is the problem solved? I also met


has the landlord problem been solved?


I really don't know what to do when I can't use ssr or history mode. Does the landlord have any ideas?

Menu