wp-renderer

Pre renderer webpack plugin for sites and SPAs.

Usage no npm install needed!

<script type="module">
  import wpRenderer from 'https://cdn.skypack.dev/wp-renderer';
</script>

README

Webpack renderer plugin

Simple Webpack plugin for pre-rendering HTML - Suitable for AWS lambda. Based on Based on the https://github.com/chrisvfritz/prerender-spa-plugin by https://github.com/chrisvfritz.


Basic Usage (webpack.config.js)

const path = require('path')
const WPRenderer = require('wp-renderer')

module.exports = {
  plugins: [
    ...
    new WPRenderer({
      // Required - The path to the webpack-outputted app to prerender.
      staticDir: path.join(__dirname, 'dist'),
      // Required - Routes to render.
      routes: [ '/', '/some-route' ],
    })
  ]
}