{"id":43945991,"url":"https://github.com/a-type/rsbuild-plugin-unocss","last_synced_at":"2026-04-02T13:02:23.996Z","repository":{"id":311082198,"uuid":"1042088849","full_name":"a-type/rsbuild-plugin-unocss","owner":"a-type","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-26T03:11:58.000Z","size":384,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-26T09:36:31.047Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/a-type.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,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-21T13:17:58.000Z","updated_at":"2026-03-26T03:12:00.000Z","dependencies_parsed_at":"2026-02-07T04:04:11.781Z","dependency_job_id":null,"html_url":"https://github.com/a-type/rsbuild-plugin-unocss","commit_stats":null,"previous_names":["a-type/rsbuild-plugin-unocss"],"tags_count":21,"template":false,"template_full_name":"rstackjs/rsbuild-plugin-template","purl":"pkg:github/a-type/rsbuild-plugin-unocss","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-type%2Frsbuild-plugin-unocss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-type%2Frsbuild-plugin-unocss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-type%2Frsbuild-plugin-unocss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-type%2Frsbuild-plugin-unocss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a-type","download_url":"https://codeload.github.com/a-type/rsbuild-plugin-unocss/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-type%2Frsbuild-plugin-unocss/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31077750,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-28T00:48:58.392Z","status":"online","status_checked_at":"2026-03-28T02:00:07.791Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":[],"created_at":"2026-02-07T03:03:26.640Z","updated_at":"2026-04-02T13:02:23.969Z","avatar_url":"https://github.com/a-type.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @a-type/rsbuild-plugin-unocss\n\nA minimal but stable Rsbuild plugin for UnoCSS, handwritten for Rsbuild instead of unplugin.\n\n\u003cp\u003e\n  \u003ca href=\"https://npmjs.com/package/@a-type/rsbuild-plugin-unocss\"\u003e\n   \u003cimg src=\"https://img.shields.io/npm/v/rsbuild-plugin-unocss?style=flat-square\u0026colorA=564341\u0026colorB=EDED91\" alt=\"npm version\" /\u003e\n  \u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square\u0026colorA=564341\u0026colorB=EDED91\" alt=\"license\" /\u003e\n  \u003ca href=\"https://npmcharts.com/compare/@a-type/rsbuild-plugin-unocss?minimal=true\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/@a-type/rsbuild-plugin-unocss.svg?style=flat-square\u0026colorA=564341\u0026colorB=EDED91\" alt=\"downloads\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Features\n\nThis plugin doesn't support all UnoCSS features, but it does support some features not available in PostCSS and some workflows I wanted to experiment with for external libraries.\n\n- ✅ Transforms: rewrites source files (`pre` transforms only for now)\n- ✅ Filesystem watches in addition to bundled files (using `unoConfig.content.filesystem`)\n- ✅ Process `// @unocss-include` comments on selected external modules, even if not matched by your `content.pipeline` rules. This one makes it easy to add this magic comment to your output files in a component library and then run Uno on its output files when it's used in your actual app!\n- 🚫 Uno config watching (TODO)\n- 🚫 Uno scopes (not actually sure what these are)\n\n## Usage\n\nInstall:\n\n```bash\nnpm add @a-type/rsbuild-plugin-unocss -D\n```\n\nAdd plugin to your `rsbuild.config.ts`:\n\n```ts\n// rsbuild.config.ts\nimport { pluginUnoCss } from \"@a-type/rsbuild-plugin-unocss\";\n\nexport default {\n  plugins: [pluginUnoCss({\n    config: // a path or literal Uno config\n  })],\n};\n```\n\nImport `uno.css` in your app:\n\n```ts\nimport 'uno.css';\n```\n\n## Options\n\n### config\n\nA path to an Uno config, or a literal config object. Otherwise it should be inferred as `uno.config.ts`.\n\n- Type: `string`\n- Default: `undefined`\n- Example:\n\n```js\npluginUnoCss({\n\tconfig: 'uno.branded.config.ts',\n});\n```\n\n### enableIncludeCommentCheck\n\nPass a filter function which takes the absolute path of a bundled source file and returns `true` if you want to check it for an `@unocss-include` comment. The file does _not_ have to be in your UnoCSS `content.pipeline` matchers. You can use this to extract CSS from precompiled NPM libraries without including them in your actual UnoCSS pipeline, as long as those libraries' built sources are postprocessed to add `// @unocss-include`.\n\n- Type: `(filePath: string) =\u003e boolean`\n- Default: `undefined`\n- Example:\n\n```js\npluginUnoCss({\n\tenableIncludeCommentCheck: (filePath) =\u003e\n\t\t// make sure your test is compatible with OS-dependent path formats\n\t\t// by using path.join.\n\t\t// I also recommend including the dist/output dir in your test, to avoid\n\t\t// nested node_modules.\n\t\tfilePath.includes(path.join('@your-scope', 'component-library', 'dist')),\n});\n```\n\n### enableCacheExtractedCSS\n\nPass a filter function to enable caching the extracted CSS classes from particular files. By default this caches any extractions from files in `node_modules` (see `enableIncludeCommentCheck` for why you might have extracted files from `node_modules`).\n\nYou may need to change this if you are in a monorepo and want to extract CSS from other projects linked via `node_modules`. Without excluding them using this filter, their initial extracted CSS will be cached and they won't be scanned for changes. Return `false` for files matching your monorepo projects to re-enable live CSS reloading on them.\n\n- Type: `(filePath: string) =\u003e boolean`\n- Default: `(filePath: string) =\u003e filePath.includes('node_modules')`\n- Example:\n\n```js\npluginUnoCss({\n\tenableCacheExtractedCSS: (filePath) =\u003e\n\t\tfilePath.includes(`@my-monorepo-scope`)\n\t\t\t? false\n\t\t\t: filePath.includes('node_modules'),\n});\n```\n\n### disableTransform\n\nSelectively disable applying your Uno transforms on specific files. This can speed up builds if you know certain files don't need transforms, particularly if you have included pre-transformed files in your content.pipeline configuration.\n\n- Type: `(filePath: string) =\u003e boolean`\n- Default: `(filePath: string) =\u003e filePath.includes('node_modules')`\n- Example:\n\n```js\npluginUnoCss({\n\tdisableTransform: (filePath) =\u003e filePath.includes('tests'),\n});\n```\n\n## License\n\n[MIT](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-type%2Frsbuild-plugin-unocss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa-type%2Frsbuild-plugin-unocss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-type%2Frsbuild-plugin-unocss/lists"}