headless-spa-prerender
Pre-render single page application states and save as static HTML pages.
$ npm install headless-spa-prerender --save-dev
Synopsis
prerender(...pages: Array<string>, destination: string, options?: Object)
Parameters
pages
<Array> - list of URLs to parse.destination
<string> - output directory.options
<Object> - optional.- pendingScripts <Array> - list of script names to load before parsing. You can also specify a part of the names (e.g. "bundle" for "bundle-1.js", "bundle-2.js", etc.).
- clearTags <Array|false> - list of tags to remove before saving. Default:
['scripts']
. - renderTimeout <int> - timeout for render page DOM before parsing. Default: 1000ms.
Example
const prerender = ; const host = 'https://promonavigator.co.id'; const pageUrls = `/about` `/contacts` `/faq` `/index` `/prices` `/ref-land`; ;