{"id":28575175,"url":"https://github.com/unjs/obuild","last_synced_at":"2026-01-22T18:44:57.495Z","repository":{"id":289253300,"uuid":"967457208","full_name":"unjs/obuild","owner":"unjs","description":"📦 😯 Zero-config ESM/TS package builder. powered by oxc, rolldown and rolldown-plugin-dts.","archived":false,"fork":false,"pushed_at":"2026-01-20T01:24:09.000Z","size":1493,"stargazers_count":372,"open_issues_count":9,"forks_count":16,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-01-20T06:12:17.321Z","etag":null,"topics":[],"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/unjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-04-16T13:36:55.000Z","updated_at":"2026-01-20T01:24:13.000Z","dependencies_parsed_at":"2025-04-22T11:14:20.571Z","dependency_job_id":"2e00e58b-2320-4780-a9ec-29e4f9e170ba","html_url":"https://github.com/unjs/obuild","commit_stats":null,"previous_names":["unjs/obuild"],"tags_count":33,"template":false,"template_full_name":null,"purl":"pkg:github/unjs/obuild","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unjs%2Fobuild","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unjs%2Fobuild/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unjs%2Fobuild/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unjs%2Fobuild/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unjs","download_url":"https://codeload.github.com/unjs/obuild/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unjs%2Fobuild/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28668315,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T17:07:18.858Z","status":"ssl_error","status_checked_at":"2026-01-22T17:05:02.040Z","response_time":144,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2025-06-10T22:41:48.212Z","updated_at":"2026-01-22T18:44:57.453Z","avatar_url":"https://github.com/unjs.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# 📦 obuild 😯\n\n✅ Zero-config ESM/TS package builder.\n\nPowered by [**oxc**](https://oxc.rs/), [**rolldown**](https://rolldown.rs/) and [**rolldown-plugin-dts**](https://github.com/sxzz/rolldown-plugin-dts).\n\nThe **obuild** project aims to be the next-generation successor to the current [unbuild](https://github.com/unjs/unbuild).\n\n- 👌 Focus on ESM compatibility.\n- 🌱 Fresh rewrite with cleanups and removal of legacy features.\n- 🚀 Using [**oxc**](https://oxc.rs/) (for transform) and [**rolldown**](https://rolldown.rs/) (for bundle) for much faster builds!\n\nSome differences are not easy to adopt. Developing as a standalone project allows for faster progress and dogfooding in real projects.\n\n## Proof of Concept\n\n\u003e [!IMPORTANT]\n\u003e\n\u003e This is a proof-of-concept project.\n\u003e\n\u003e Features are incomplete, and API and output behavior may change between 0.x versions.\n\u003e\n\u003e Feedback and contributions are very welcome! If you'd like to make changes with more than a few lines of code, please open an issue first to discuss.\n\n## Currently Used by\n\n- [📦 obuild](https://github.com/unjs/obuild/)\n- [🌳 rou3](https://github.com/h3js/rou3/)\n- [💥 srvx](https://github.com/h3js/srvx)\n- [🕊️ unenv](https://github.com/unjs/unenv)\n- [🕰️ omnichron](https://github.com/oritwoen/omnichron)\n- [⚙️ c12](https://github.com/unjs/c12)\n- [...add yours...]\n\n## Usage\n\n### CLI\n\n```sh\n# bundle\nnpx obuild ./src/index.ts\n\n# transform\nnpx obuild ./src/runtime/:./dist/runtime\n```\n\nYou can use `--dir` to set the working directory.\n\nIf paths end with `/`, obuild uses transpile mode using [oxc-transform](https://www.npmjs.com/package/oxc-transform) instead of bundle mode with [rolldown](https://rolldown.rs/).\n\n### Programmatic\n\n```js\nimport { build } from \"obuild\";\n\nawait build({\n  cwd: \".\",\n  entries: [\"./src/index.ts\"],\n});\n```\n\n## Config\n\nYou can use `build.config.mjs` (or `.ts`) or pass config to `build()` function.\n\n```js\nimport { defineBuildConfig } from \"obuild/config\";\n\nexport default defineBuildConfig({\n  entries: [\n    {\n      type: \"bundle\",\n      input: [\"./src/index.ts\", \"./src/cli.ts\"],\n      // outDir: \"./dist\",\n      // minify: false,\n      // stub: false,\n      // rolldown: {}, // https://rolldown.rs/reference/config-options\n      // dts: {}, // https://github.com/sxzz/rolldown-plugin-dts#options\n    },\n    {\n      type: \"transform\",\n      input: \"./src/runtime\",\n      outDir: \"./dist/runtime\",\n      // minify: false,\n      // stub: false,\n      // oxc: {},\n      // resolve: {}\n    },\n  ],\n  hooks: {\n    // start: (ctx) =\u003e {},\n    // end: (ctx) =\u003e {},\n    // entries: (entries, ctx) =\u003e {},\n    // rolldownConfig: (config, ctx) =\u003e {},\n    // rolldownOutput: (output, res, ctx) =\u003e {},\n  },\n});\n```\n\n## Stub Mode\n\nWhen working on a package locally, it can be tedious to rebuild or run the watch command every time.\n\nYou can use `stub: true` (per entry config) or the `--stub` CLI flag. In this mode, obuild skips the actual build and instead links the expected dist paths to the source files.\n\n- For bundle entries, `.mjs` and `.d.mts` files re-export the source file.\n- For transpile entries, src dir is symlinked to dist.\n\n**Caveats:**\n\n- You need a runtime that natively supports TypeScript. Deno, Bun, Vite, and Node.js (1)\n- For transpile mode, you need to configure your bundler to resolve either `.ts` or `.mjs` extensions.\n- For bundle mode, if you add a new entry or add/remove a `default` export, you need to run the stub build again.\n\n(1) For Node.js, you have several options:\n\n- Using `node --experimental-strip-types` (Available in [22.6](https://nodejs.org/en/blog/release/v22.6.0))\n- Using [jiti](https://github.com/unjs/jiti) (`node --import jiti/register`)\n- Using [oxc-node](https://github.com/oxc-project/oxc-node) (`node --import @oxc-node/core/register`)\n- Using [unloader](https://github.com/sxzz/unloader) (`node --import unloader/register`)\n\n## Prior Arts\n\n- [unbuild](https://github.com/unjs/unbuild): Stable solution based on rollup and [mkdist](https://github.com/unjs/mkdist).\n- [tsdown](https://tsdown.dev/): Alternative bundler based on rolldown.\n\n## License\n\n💛 Released under the [MIT](./LICENSE) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funjs%2Fobuild","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funjs%2Fobuild","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funjs%2Fobuild/lists"}