{"id":15164442,"url":"https://github.com/markthree/nuxt-style-extractor","last_synced_at":"2025-09-30T19:31:05.192Z","repository":{"id":255368439,"uuid":"843434685","full_name":"markthree/nuxt-style-extractor","owner":"markthree","description":"Extracts the style of the page as an external css when rendered on the server side | 提取服务端渲染时页面的 style 为外部 css","archived":false,"fork":false,"pushed_at":"2024-10-23T13:28:54.000Z","size":767,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-25T02:08:54.563Z","etag":null,"topics":["css","extractor","nuxt","optimization","style"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markthree.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2024-08-16T14:03:33.000Z","updated_at":"2024-10-23T13:28:58.000Z","dependencies_parsed_at":"2024-11-15T21:26:20.924Z","dependency_job_id":"937f442a-480e-4612-a29d-cc69ca6d0190","html_url":"https://github.com/markthree/nuxt-style-extractor","commit_stats":{"total_commits":11,"total_committers":1,"mean_commits":11.0,"dds":0.0,"last_synced_commit":"adb18eb1c35217391229a26ec1efcc9055fccce8"},"previous_names":["markthree/nuxt-style-extractor"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markthree%2Fnuxt-style-extractor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markthree%2Fnuxt-style-extractor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markthree%2Fnuxt-style-extractor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markthree%2Fnuxt-style-extractor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markthree","download_url":"https://codeload.github.com/markthree/nuxt-style-extractor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234767189,"owners_count":18883397,"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":["css","extractor","nuxt","optimization","style"],"created_at":"2024-09-27T03:23:40.259Z","updated_at":"2025-09-30T19:31:05.185Z","avatar_url":"https://github.com/markthree.png","language":"TypeScript","readme":"# nuxt-style-extractor\n\nExtracts the style of the page as an external css when rendered on the server\nside\n\n\u003cbr /\u003e\n\n## README 🦉\n\n[简体中文](./README_CN.md) | English\n\n\u003cbr /\u003e\n\n## Motivation\n\nFaster rendering and more readable seo\n\n\u003cbr /\u003e\n\n## Features\n\n\u003c!-- Highlight some of the features your module provide here --\u003e\n\n- 🚠 \u0026nbsp;Optimal Caching\n- ⛰ \u0026nbsp;Supports ssg, ssr and ssr with pre-rendering.\n- 🌲 \u0026nbsp;Intelligent minification extraction, removing unused styles from the\n  page, merging duplicate styles\n\n\u003cbr /\u003e\n\n## Quick Setup\n\n### Install the module\n\n```bash\nnpm i nuxt-style-extractor\n```\n\n### Setup Module\n\n```ts\n// nuxt.config.ts\nexport default defineNuxtConfig({\n  modules: [\"nuxt-style-extractor\"],\n});\n```\n\nThat's all. Everything's automatic.\n\n### Configuration\n\nOf course, you can also configure it.\n\n```ts\n// nuxt.config.ts\nexport default defineNuxtConfig({\n  styleExtractor: {\n    minify: true, // Whether to enable minification\n    removeUnused: true, // Whether to remove unused styles\n  },\n});\n```\n\n#### Preserve Original State\n\nIf you don't need any optimization and want to maintain the original order of styles, you can set `original` to `true`\n\n```ts\nexport default defineNuxtConfig({\n  styleExtractor: {\n    original: true, // Only extract CSS without any optimization processing\n  },\n});\n```\n\n#### Custom Transformer\n\n```ts\n// style-extractor.js\nexport default (options) =\u003e {\n  return options.css + \"body { background: red }\";\n};\n// nuxt.config.ts\nexport default defineNuxtConfig({\n  styleExtractor: {\n    transformFile: \"style-extractor.js\",\n  },\n});\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkthree%2Fnuxt-style-extractor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkthree%2Fnuxt-style-extractor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkthree%2Fnuxt-style-extractor/lists"}