Prerender your JS app without Server-Side Rendering
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
.gitignore
.prettierrc
README.md
index.js
package.json
yarn.lock

README.md

prerenderer-cli

Uses prerenderer to generate prerendered versions of static HTML assets. This is useful if your page is implemented using e.g. React, and you would not like to implement server-side rendering but would like to benefit from fast initial page loads.

Usage:

yarn global add https://github.com/Ezku/prerenderer-cli
prerender <options> [files]

Options:

  • --source=<directory>: base directory for prerendered files, in relation to current working directory
  • --target=<directory>: target directory for prerendered files, in relation to current working directory
  • --renderer=<name>: puppeteer or jsdom, optional, defaults to jsdom
  • all key-value options not specified here: optional arguments to renderer
  • [files]: list of file names in relation to source directory

Example:

prerender \
  --renderer=puppeteer \
  --source=dist \
  --target=prerendered \
  --renderAfterDocumentEvent=render-complete \
  index.html

This command uses puppeteer to render dist/index.html, waits for the document to emit render-complete and saves the document to prerendered/index.html.