chentschel / wp-renderer

Simlple Webpack static renderer plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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' ],
    })
  ]
}

About

Simlple Webpack static renderer plugin

License:MIT License


Languages

Language:JavaScript 100.0%