{"id":20105919,"url":"https://github.com/markthree/vitepress-payload-extractor","last_synced_at":"2025-03-02T17:47:07.265Z","repository":{"id":176407928,"uuid":"657913733","full_name":"markthree/vitepress-payload-extractor","owner":"markthree","description":"Extracting duplicate payloads of meta information after vitepress wrapping | 提取 vitepress 打包后重复的有效元信息载荷","archived":false,"fork":false,"pushed_at":"2024-02-28T05:23:23.000Z","size":80,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-13T10:47:54.774Z","etag":null,"topics":["extractor","optimization","payload","vitepress"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/vitepress-payload-extractor","language":"TypeScript","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/markthree.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-06-24T07:36:09.000Z","updated_at":"2023-07-16T10:48:59.000Z","dependencies_parsed_at":"2024-02-28T06:28:57.650Z","dependency_job_id":"3ae608df-8b4f-4cd3-94a6-a5725c3859a8","html_url":"https://github.com/markthree/vitepress-payload-extractor","commit_stats":null,"previous_names":["markthree/vitepress-payload-extractor"],"tags_count":7,"template":false,"template_full_name":"markthree/node-lib-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markthree%2Fvitepress-payload-extractor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markthree%2Fvitepress-payload-extractor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markthree%2Fvitepress-payload-extractor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markthree%2Fvitepress-payload-extractor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markthree","download_url":"https://codeload.github.com/markthree/vitepress-payload-extractor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241549089,"owners_count":19980475,"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":["extractor","optimization","payload","vitepress"],"created_at":"2024-11-13T17:48:33.514Z","updated_at":"2025-03-02T17:47:07.236Z","avatar_url":"https://github.com/markthree.png","language":"TypeScript","readme":"# vitepress-payload-extractor\n\nExtracting duplicate payloads of meta information after vitepress wrapping\n\n\u003cbr /\u003e\n\nThis project has been `blocked`, because the `vitepress`\n[1.0.0-beta.6](https://github.com/vuejs/vitepress/pull/2626) Supported\n[metaChunk](https://github.com/vuejs/vitepress/pull/2626) option\n\n\u003cbr /\u003e\n\n## README 🦉\n\n[简体中文](./README_CN.md) | English\n\n\u003cbr /\u003e\n\n## Motivation\n\nOur team was using [vitepress](https://github.com/vuejs/vitepress) to build\nlarge project documents, but as the number of documents grew, the meta\ninformation payload of html pages became oversized, so I made this tool that\nextracts the duplicate payload of pages and reduces the size of the package.\n\nWith it, our team's production documents went from `255MB` to `94.4MB`, which is\n`37%` of the original size. If you are in the same dilemma, maybe you can try\nthis tool!\n\n\u003cbr /\u003e\n\n## Usage\n\n### install\n\n```shell\nnpm i vitepress-payload-extractor -D\n```\n\n### Configuration\n\nIntroduce the package in your `vitepress` configuration file\n\n#### optimizeHtml\n\nExtract duplicate meta information payloads during `vitepress` packaging and\ncompress `html`.\n\n```ts\nimport { defineConfig } from \"vitepress\";\nimport { optimizeHtml } from \"vitepress-payload-extractor\";\n\nexport default defineConfig({\n  transformHtml(code) {\n    return optimizeHtml(code);\n  },\n});\n```\n\n---\n\n#### payloadExtraction\n\nExtract duplicate meta-message payloads during `vitepress` packaging process\n\n```ts\n// .vitepress/config.js\nimport { defineConfig } from \"vitepress\";\nimport { payloadExtraction } from \"vitepress-payload-extractor\";\n\nexport default defineConfig({\n  transformHtml(code, _, ctx) {\n    return payloadExtraction(code, ctx.siteConfig.outDir);\n  },\n});\n```\n\n\u003cbr /\u003e\n\n#### minifyHtml\n\nCompresses html and is compatible with vitepress\n\n```ts\nimport { defineConfig } from \"vitepress\";\nimport { minifyHtml } from \"vitepress-payload-extractor\";\n\nexport default defineConfig({\n  transformHtml(code) {\n    return minifyHtml(code);\n  },\n});\n```\n\n\u003cbr /\u003e\n\n## Inspiration\n\n- [DreaMinder · nuxt-payload-extractor](https://github.com/DreaMinder/nuxt-payload-extractor)\n- [nuxt · issue · Payload extraction support](https://github.com/nuxt/nuxt/issues/14507)\n\n\u003cbr /\u003e\n\n## License\n\nMade with [markthree](https://github.com/markthree)\n\nPublished under [MIT License](./LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkthree%2Fvitepress-payload-extractor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkthree%2Fvitepress-payload-extractor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkthree%2Fvitepress-payload-extractor/lists"}