{"id":19402370,"url":"https://github.com/koole/netlify-push-webpack-plugin","last_synced_at":"2025-04-24T07:31:41.426Z","repository":{"id":32981377,"uuid":"148623609","full_name":"koole/netlify-push-webpack-plugin","owner":"koole","description":"📦 Generate a Netlify HTTP2 Server Push configuration with Webpack","archived":false,"fork":false,"pushed_at":"2023-02-11T10:22:42.000Z","size":1134,"stargazers_count":7,"open_issues_count":6,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-28T04:07:04.441Z","etag":null,"topics":["html-webpack-plugin","http2","http2-push","netlify","webpack"],"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/koole.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-09-13T10:45:10.000Z","updated_at":"2022-04-11T13:13:32.000Z","dependencies_parsed_at":"2023-01-14T22:55:17.328Z","dependency_job_id":null,"html_url":"https://github.com/koole/netlify-push-webpack-plugin","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koole%2Fnetlify-push-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koole%2Fnetlify-push-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koole%2Fnetlify-push-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koole%2Fnetlify-push-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koole","download_url":"https://codeload.github.com/koole/netlify-push-webpack-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222921583,"owners_count":17058197,"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","http2","http2-push","netlify","webpack"],"created_at":"2024-11-10T11:23:24.737Z","updated_at":"2024-11-10T11:23:25.322Z","avatar_url":"https://github.com/koole.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NetlifyPushWebpackPlugin\n\nGenerate HTTP2 Server Push `_headers` file for Netlify using HtmlWebpackPlugin.\n\nFor use with Webpack 4 and HtmlWebpackPlugin 4\n\n## Installation\n\n```\nnpm i netlify-push-webpack-plugin\n```\n\nor\n\n```\nyarn add netlify-push-webpack-plugin\n```\n\n## Usage\n\n| Option     | Type   | Description                                        |\n| ---------- | ------ | -------------------------------------------------- |\n| `filename` | String | Name and path of the generated headers file        |\n| `headers`  | Array  | Other headers to be added to the file (optional)   |\n| `include`  | String | Only include 'css', 'js' or 'all' (default: 'all') |\n\n## Example\n\nThe following config\n\n```js\nconst HtmlWebpackPlugin = require(\"html-webpack-plugin\");\nconst NetlifyServerPushPlugin = require(\"netlify-push-webpack-plugin\");\n\nmodule.exports = {\n  plugins: [\n    new HtmlWebpackPlugin(),\n    new NetlifyServerPushPlugin({\n      filename: \"_headers\",\n      headers: [\n        \"  X-Frame-Options: DENY\",\n        \"  Referrer-Policy: strict-origin-when-cross-origin\",\n        \"/assets/*\",\n        \"  Cache-Control: public, max-age:360000\"\n      ],\n      include: \"css\"\n    })\n  ]\n};\n```\n\nwill result in a headers file looking something like this:\n\n```\n/*\n  Link: \u003cbundle.js\u003e; rel=preload; as=script\n  Link: \u003cmain.css\u003e; rel=preload; as=style\n  X-Frame-Options: DENY\n  Referrer-Policy: strict-origin-when-cross-origin\n/assets/*\n  Cache-Control: public, max-age:360000\n```\n\n## Testing\n\nTests are ran using using Ava with the following command:\n\n```\nnpm run test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoole%2Fnetlify-push-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoole%2Fnetlify-push-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoole%2Fnetlify-push-webpack-plugin/lists"}