{"id":23545194,"url":"https://github.com/dgeibi/simple-prerender-webpack-plugin","last_synced_at":"2025-07-11T12:34:17.504Z","repository":{"id":57360623,"uuid":"122323273","full_name":"dgeibi/simple-prerender-webpack-plugin","owner":"dgeibi","description":"Build Time Rendering with webpack and html-webpack-plugin","archived":false,"fork":false,"pushed_at":"2018-10-07T07:00:04.000Z","size":1314,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-27T22:37:54.943Z","etag":null,"topics":["html-webpack-plugin","prerender","webpack","webpack-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dgeibi.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-02-21T10:41:21.000Z","updated_at":"2018-10-07T07:00:05.000Z","dependencies_parsed_at":"2022-09-06T22:20:55.171Z","dependency_job_id":null,"html_url":"https://github.com/dgeibi/simple-prerender-webpack-plugin","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/dgeibi/simple-prerender-webpack-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgeibi%2Fsimple-prerender-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgeibi%2Fsimple-prerender-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgeibi%2Fsimple-prerender-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgeibi%2Fsimple-prerender-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dgeibi","download_url":"https://codeload.github.com/dgeibi/simple-prerender-webpack-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgeibi%2Fsimple-prerender-webpack-plugin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264362225,"owners_count":23596459,"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","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":["html-webpack-plugin","prerender","webpack","webpack-plugin"],"created_at":"2024-12-26T08:15:24.159Z","updated_at":"2025-07-11T12:34:17.195Z","avatar_url":"https://github.com/dgeibi.png","language":"JavaScript","readme":"# simple-prerender-webpack-plugin\n\n[![version][version-badge]][package]\n\n## Features\n\n- Based on Promise\n- Support dynamic import\n- Sourcemap: to enable sourcemap just configure webpack with `devtool: source-map`\n- Inject rendering result into html-webpack-plugin as `htmlWebpackPlugin.options.prerendered`\n\n## Install\n\n```sh\n$ npm install webpack html-webpack-plugin@next\n$ npm install simple-prerender-webpack-plugin\n```\n\n## Examples\n\n- [examples](examples)\n- [dgeibi/yarb](https://github.com/dgeibi/yarb)\n\n## Usage\n\n`webpack.config.js`:\n\n```js\nconst SimplePrerenderWebpackPlugin = require('simple-prerender-webpack-plugin')\nconst HtmlWebpackPlugin = require('html-webpack-plugin')\n\nmodule.exports = {\n  entry: './src/index.js',\n\n  plugins: [\n    new HtmlWebpackPlugin({\n      filename: 'page1.html',\n      template: './src/template.ejs',\n    }),\n    new HtmlWebpackPlugin({\n      filename: 'page2.html',\n      template: './src/template.ejs',\n    }),\n    new SimplePrerenderWebpackPlugin({\n      // (optional) path to file which exports a prerender function\n      // \u003cstring|string[]\u003e\n      // defaults to './src/index.js'\n      entry: './src/ssr.js',\n\n      // (optional)\n      // \u003cstring\u003e: path to partial webpack config\n      // \u003cobject\u003e: partial webpack config\n      config: {\n        plugins: [],\n        externals: [],\n        entry: './src/ssr.js',\n        module: {},\n      },\n\n      // (optional): \u003cstring\u003e filename of output\n      filename: 'prerender.js',\n\n      // (optional): \u003cstring\u003e\n      chunkFilename: 'prerender.[id].js',\n\n      // (optional): \u003cany\u003e, see `examples/multi-instance`\n      id: '',\n\n      // (optional): \u003cboolean\u003e whether write output to disk\n      writeToDisk: false,\n\n      // (optional): \u003cobject\u003e opts passed to webpack-node-externals\n      // see also https://www.npmjs.com/package/webpack-node-externals\n      nodeExternalsOptions: {},\n    }),\n  ],\n}\n```\n\n`./src/template.ejs`:\n\n```ejs\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"UTF-8\"\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, minimum-scale=1.0\"\u003e\n  \u003ctitle\u003e\u003c%= htmlWebpackPlugin.options.title %\u003e\u003c/title\u003e\n\u003c/head\u003e\n\u003cbody\u003e\u003cdiv id=\"root\"\u003e\u003c%= htmlWebpackPlugin.options.prerendered %\u003e\u003c/div\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n`./src/ssr.js`:\n\n```js\nexport default ({\n  outputName, // html filename\n  plugin, // html-webpack-plugin instance\n  assets, // html-webpack-plugin assets\n  compilation,\n  compiler,\n}) =\u003e {\n  return `\u003cdiv\u003e${outputName}\u003c/div\u003e`\n}\n```\n\n## LICENSE\n\n[MIT](LICENSE)\n\n[version-badge]: https://img.shields.io/npm/v/simple-prerender-webpack-plugin.svg\n[package]: https://www.npmjs.com/package/simple-prerender-webpack-plugin\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgeibi%2Fsimple-prerender-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdgeibi%2Fsimple-prerender-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgeibi%2Fsimple-prerender-webpack-plugin/lists"}