{"id":24964525,"url":"https://github.com/stacksjs/bun-plugin-unocss","last_synced_at":"2025-04-15T19:39:47.900Z","repository":{"id":275494710,"uuid":"926234496","full_name":"stacksjs/bun-plugin-unocss","owner":"stacksjs","description":"Bun plugin for UnoCSS support.","archived":false,"fork":false,"pushed_at":"2025-04-11T21:13:24.000Z","size":400,"stargazers_count":7,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T22:26:52.627Z","etag":null,"topics":["bun","bun-plugin","unocss"],"latest_commit_sha":null,"homepage":"","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/stacksjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["stacksjs","chrisbbreuer"],"open_collective":"stacksjs"}},"created_at":"2025-02-02T21:21:02.000Z","updated_at":"2025-03-24T17:46:57.000Z","dependencies_parsed_at":"2025-02-02T22:28:32.475Z","dependency_job_id":"e21d1375-9741-412f-9e54-a98a41da88a3","html_url":"https://github.com/stacksjs/bun-plugin-unocss","commit_stats":null,"previous_names":["stacksjs/bun-plugin-unocss"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fbun-plugin-unocss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fbun-plugin-unocss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fbun-plugin-unocss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fbun-plugin-unocss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stacksjs","download_url":"https://codeload.github.com/stacksjs/bun-plugin-unocss/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248618688,"owners_count":21134282,"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":["bun","bun-plugin","unocss"],"created_at":"2025-02-03T10:16:23.762Z","updated_at":"2025-04-15T19:39:47.878Z","avatar_url":"https://github.com/stacksjs.png","language":"TypeScript","funding_links":["https://github.com/sponsors/stacksjs","https://github.com/sponsors/chrisbbreuer","https://opencollective.com/stacksjs"],"categories":[],"sub_categories":[],"readme":"![Social Card of Bun Plugin unocss](https://github.com/stacksjs/bun-plugin-unocss/blob/main/.github/art/cover.jpg)\n\n[![npm version][npm-version-src]][npm-version-href]\n[![GitHub Actions][github-actions-src]][github-actions-href]\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n[![npm downloads][npm-downloads-src]][npm-downloads-href]\n\u003c!-- [![Codecov][codecov-src]][codecov-href] --\u003e\n\n# bun-plugin-unocss\n\n\u003e \"Instant On-demand Atomic CSS Engine\" - UnoCSS\n\n## Features\n\n- 💉 Automatic injection of generated CSS into HTML files\n- 🪄 On-demand CSS generation using UnoCSS core\n- 🚀 Seamless integration with Bun's build system\n- 📦 Support for HTML file processing with UnoCSS rules\n- 🎨 Highly configurable\n- 🔄 Real-time CSS generation during development\n- ⚡ Zero-config setup with automatic UnoCSS config detection\n\n## Usage\n\n```bash\nbun install -d bun-plugin-unocss\n```\n\n### Bundler\n\nYou may now use the plugin now via `Bun.build`:\n\n```ts\n// build.ts\nimport type { UserConfig } from 'unocss'\nimport { plugin as unocss } from 'bun-plugin-unocss'\n// import unocss from 'bun-plugin-unocss'\n\nconst config: UserConfig = {\n  // Your UnoCSS config\n}\n\nBun.build({\n  entrypoints: ['./src/index.html'],\n  outdir: './dist',\n  plugins: [\n    unocss, // by default, it will look for the Uno config file in the project root\n  ],\n})\n```\n\n### Server\n\nAdditionally, it can also be used in conjunction with HTML imports, via `Bun.serve()`:\n\n```ts\n// server.ts\nimport home from './home.html'\n\nconst server = Bun.serve({\n  static: {\n    // Bundle \u0026 route home.html to \"/home\"\n    '/': home,\n  },\n\n  async fetch(req) {\n    console.log('any other request', req.url)\n\n    // Return 404 for unmatched routes\n    return new Response('Not Found', { status: 404 })\n  },\n})\n\nconsole.log(`Listening on ${server.url}`)\n```\n\n```html\n\u003c!-- home.html --\u003e\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\n\u003chead\u003e\n  \u003ctitle\u003eHome\u003c/title\u003e\n\u003c/head\u003e\n\n\u003cbody\u003e\n  \u003cdiv id=\"root\"\u003eRoot Element\u003c/div\u003e\n  \u003cdiv class=\"mt-24 text-red-500\"\u003eTest\u003c/div\u003e\n\u003c/body\u003e\n\n\u003c/html\u003e\n```\n\n#### Configuration\n\nFor this to work, though, you have to ensure that the plugin is defined in your `bunfig.toml`:\n\n```toml\n[serve.static]\nplugins = [ \"bun-plugin-unocss\" ]\n```\n\n## Testing\n\n```bash\nbun test\n```\n\n## Changelog\n\nPlease see our [releases](https://github.com/stacksjs/bun-plugin-unocss/releases) page for more information on what has changed recently.\n\n## Contributing\n\nPlease review the [Contributing Guide](https://github.com/stacksjs/contributing) for details.\n\n## Community\n\nFor help, discussion about best practices, or any other conversation that would benefit from being searchable:\n\n[Discussions on GitHub](https://github.com/stacksjs/stacks/discussions)\n\nFor casual chit-chat with others using this package:\n\n[Join the Stacks Discord Server](https://discord.gg/stacksjs)\n\n## Postcardware\n\n“Software that is free, but hopes for a postcard.” We love receiving postcards from around the world showing where `bun-plugin-unocss` is being used! We showcase them on our website too.\n\nOur address: Stacks.js, 12665 Village Ln #2306, Playa Vista, CA 90094, United States 🌎\n\n## Sponsors\n\nWe would like to extend our thanks to the following sponsors for funding Stacks development. If you are interested in becoming a sponsor, please reach out to us.\n\n- [JetBrains](https://www.jetbrains.com/)\n- [The Solana Foundation](https://solana.com/)\n\n## Credits\n\nMany thanks to the following core technologies \u0026 people who have contributed to this package:\n\n- [UnoCSS](https://unocss.dev)\n- [Anthony Fu](https://github.com/antfu)\n- [Chris Breuer](https://github.com/chrisbbreuer)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [LICENSE](https://github.com/stacksjs/bun-plugin-unocss/tree/main/LICENSE.md) for more information.\n\nMade with 💙\n\n\u003c!-- Badges --\u003e\n[npm-version-src]: \u003chttps://img.shields.io/npm/v/bun-plugin-unocss?style=flat-square\u003e\n[npm-version-href]: \u003chttps://npmjs.com/package/bun-plugin-unocss\u003e\n[npm-downloads-src]: \u003chttps://img.shields.io/npm/dm/bun-plugin-unocss?style=flat-square\u003e\n[npm-downloads-href]: \u003chttps://npmjs.com/package/bun-plugin-unocss\u003e\n[github-actions-src]: \u003chttps://img.shields.io/github/actions/workflow/status/stacksjs/bun-plugin-unocss/ci.yml?style=flat-square\u0026branch=main\u003e\n[github-actions-href]: \u003chttps://github.com/stacksjs/bun-plugin-unocss/actions?query=workflow%3Aci\u003e\n\n\u003c!-- [codecov-src]: https://img.shields.io/codecov/c/gh/stacksjs/bun-plugin-unocss/main?style=flat-square\n[codecov-href]: https://codecov.io/gh/stacksjs/bun-plugin-unocss --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstacksjs%2Fbun-plugin-unocss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstacksjs%2Fbun-plugin-unocss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstacksjs%2Fbun-plugin-unocss/lists"}