prerender-seo
Prerender HTML files using Puppeteer.
Install
npm i prerender-seo -D
Usage
const path =const prerender =const files ='/index.html'
Test
The test case use a vue-cli generated project
npm run test
Options
Name | Type | Default | Description |
---|---|---|---|
sourceDir |
{String} |
- |
Source directory of static files |
files |
{Array} |
- |
HTML Files to prerender |
options.destDir |
{String} |
*_prerender |
Destination directory to store the result |
options.proxyTable |
{Array} |
[] |
Proxy to forward any http request that match the config |
options.navigationTimeout |
{Number} |
30000 |
Define the timeout of any navigation operations |
options.resourceInterception |
{Array} |
[] |
Define the regular expression of any resource will be aborted |
sourceDir
files
options.destDir
Define the destination directory. If you want to replace the source directory, just set the same path as sourceDir
.
options.proxyTable
options.navigationTimeout
Define the timeout after which any navigation operations will stop trying. (in milli-secs)
options.resourceInterception
Define the regular expression to match any resource url will be aborted before request. The left hand in the array is RegExp
pattern, the right hand is RegExp
flag.