Frame Spa Prerenderer
Simple renderer to be used with webpack prerender-spa-plugin, based on Puppeteer Renderer. The idea is to block every request for new components so it will only prerender the initial frame. Everything in the initial bundles (defined in the acceptExceptions parameter) will be rendered. Whatever you do synchronously, without code splitting or any external requests will be included.
It's in ES6
Example with VueJs
vue.config.js
const path = const PrerenderSPAPlugin = // PLUGINconst BlockAllRequestsRenderer = // THIS RENDERER CLASS moduleexports = { configplugins config } configureWebpack: plugins: // Required - The path to the webpack-outputted app to prerender. staticDir: path // Required - Routes to render. routes: '/' minify: collapseBooleanAttributes: true collapseWhitespace: false decodeEntities: true keepClosingSlash: true sortAttributes: true // DEFINE FILES TO BE INITIALLY INCLUDED (INITIAL BUNDLES) // EVERYTHING ELSE WILL BE BLOCKED renderer: acceptExceptions: /\/js\/app.js/ /\/js\/chunk-vendors.js/