{"id":22093466,"url":"https://github.com/mubaidr/prerender-plugin","last_synced_at":"2025-07-24T20:32:53.753Z","repository":{"id":48989392,"uuid":"116155510","full_name":"mubaidr/prerender-plugin","owner":"mubaidr","description":"A Node.js/ webpack plugin to prerender static HTML in a single-page application.","archived":false,"fork":false,"pushed_at":"2021-07-01T22:15:29.000Z","size":1581,"stargazers_count":14,"open_issues_count":24,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-23T09:51:39.016Z","etag":null,"topics":["nodejs","prerender","prerender-plugin","single-page-applications","spa","webpack","webpack4"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mubaidr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-03T15:59:24.000Z","updated_at":"2024-09-30T23:31:25.000Z","dependencies_parsed_at":"2022-09-05T07:41:01.927Z","dependency_job_id":null,"html_url":"https://github.com/mubaidr/prerender-plugin","commit_stats":null,"previous_names":["mubaidr/webpack-prerender-plugin"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mubaidr/prerender-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mubaidr%2Fprerender-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mubaidr%2Fprerender-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mubaidr%2Fprerender-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mubaidr%2Fprerender-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mubaidr","download_url":"https://codeload.github.com/mubaidr/prerender-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mubaidr%2Fprerender-plugin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266710021,"owners_count":23972264,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nodejs","prerender","prerender-plugin","single-page-applications","spa","webpack","webpack4"],"created_at":"2024-12-01T03:14:45.481Z","updated_at":"2025-07-24T20:32:53.091Z","avatar_url":"https://github.com/mubaidr.png","language":"JavaScript","readme":"# prerender-plugin\n\n[![NPM](https://nodei.co/npm/prerender-plugin.png?compact=true)](https://nodei.co/npm/prerender-plugin/)\n\nNode.js/webpack module/plugin to prerender static HTML in a single-page application.\n\n## What is Prerendering?\n\nPrerendering is a process to preload all elements on the page in preparation for a web crawler to see it. If you’re using a Single Page Application (SPA) for a site that’s not behind a login and SEO is an important concern then this plugin could help you easily generate pre-rendered version of your application.\n\n## Installation\n\n```js\nnpm install prerender-plugin\n```\n\n## Usage\n\nThis package can be used either directly with Node.js or with webpack build process.\n\n### Node.js\n\n```js\nvar PrerenderPlugin = require('prerender-plugin')\nnew PrerenderPlugin(options).apply()\n```\n\n### Webpack\n\n```js\n// webpack.config.js or webpack.prod.conf.js\nvar PrerenderPlugin = require('prerender-plugin')\n\nmodule.exports = {\n  // ...\n  plugins: [\n    // ...\n    new PrerenderPlugin(options)\n  ]\n}\n```\n\n## Options\n\n| Option           | Type                      | Required | Default | Description                                                                                                                                                            |\n| ---------------- | ------------------------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| source           | String                    | Yes      |         | Path of the web application.                                                                                                                                           |\n| target           | String                    |          | source  | Path to save generated content.                                                                                                                                        |\n| routes           | Array of Strings          |          | ['/']   | Routes which will be pre-rendered.                                                                                                                                     |\n| capture.delay    | Integer                   |          | 1000ms  | Time to wait before page capture.                                                                                                                                      |\n| capture.event    | String                    |          |         | Custom event for page capture.                                                                                                                                         |\n| capture.selector | String                    |          |         | Wait until selected selector is available in the page before page capture.                                                                                             |\n| postProcess      | Function (content, route) |          |         | A function to process the generated HTML content. This function must return the final processed content. `Content` \u0026 `route` are the only parameters for this function |\n\n### Notes:\n\n* If two or more capture optons are provided, page capture will occur on the earliest of the provided options.\n* If `capture.event` or `capture.selector` option is being used then `capture.delay` will act as timeout (default 10s).\n\n## Examples\n\nPlese check the `examples` folder in the root directory for both Node.js and Webpack usage.\n\nDevelopment of this plugin is inspired by [prerender-spa-plugin](https://github.com/chrisvfritz/prerender-spa-plugin)\n","funding_links":[],"categories":["Prerendering [🔝](#readme)","预烧结","Components \u0026 Libraries","Prerendering"],"sub_categories":["命令行/终端","Prerendering","Command Line / Terminal"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmubaidr%2Fprerender-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmubaidr%2Fprerender-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmubaidr%2Fprerender-plugin/lists"}