chrisvfritz / prerender-spa-plugin

Prerenders static HTML in a single-page application.
MIT License
7.31k stars 633 forks source link

Plugin doesn't copy assets #452

Open luka-bacic opened 3 years ago

luka-bacic commented 3 years ago

Hi,

I am using prerender-spa-plugin 3.4.0 with Vue 3.0.11.

I'm running Ubuntu 18.04.5 LTS in WSL2

My plugin config options in vue.config.js are as follows:

const path = require('path');
const PrerenderSPAPlugin = require('prerender-spa-plugin');
const Renderer = PrerenderSPAPlugin.PuppeteerRenderer;

module.exports = {
  // ...
  configureWebpack: {
    plugins: [
      new PrerenderSPAPlugin({
        staticDir: path.join(__dirname, 'dist'),
        outputDir: path.join(__dirname, 'prerendered'),
        routes: ['/'],
        renderer: new Renderer({
          renderAfterDocumentEvent: 'dataFetched',
        }),
      }),
    ],
  },
};

This creates an index.html in the prerendered folder, but it doesn't copy any of the other files under dist folder (so all assets under css/ javascript/ and fonts/ are not copied over).

Is this intended behaviour of this plugin? I haven't been able to find any config options that could modify this. I've also searched and couldn't find any issues online mentioning assets copying (whether it is intended or not)