{"id":15369118,"url":"https://github.com/developit/microbundle-2","last_synced_at":"2025-04-14T03:14:55.130Z","repository":{"id":249296149,"uuid":"831118705","full_name":"developit/microbundle-2","owner":"developit","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-14T15:57:54.000Z","size":39,"stargazers_count":41,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T03:14:42.227Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/developit.png","metadata":{"files":{"readme":"README.md","changelog":null,"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-07-19T17:48:38.000Z","updated_at":"2025-03-30T10:28:54.000Z","dependencies_parsed_at":"2024-11-01T01:02:00.183Z","dependency_job_id":null,"html_url":"https://github.com/developit/microbundle-2","commit_stats":{"total_commits":5,"total_committers":2,"mean_commits":2.5,"dds":0.4,"last_synced_commit":"274f279bdc8abfb33d484c69cf34873870b46887"},"previous_names":["developit/microbundle-2"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developit%2Fmicrobundle-2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developit%2Fmicrobundle-2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developit%2Fmicrobundle-2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developit%2Fmicrobundle-2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/developit","download_url":"https://codeload.github.com/developit/microbundle-2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248813803,"owners_count":21165634,"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":[],"created_at":"2024-10-01T13:34:16.247Z","updated_at":"2025-04-14T03:14:55.112Z","avatar_url":"https://github.com/developit.png","language":"JavaScript","readme":"# Microbundle 2\n\nWhat if microbundle could figure out how to bundle your library based on the `\"exports\"` field you already have to define in your package.json?\n\nAnd what if it was also absurdly fast, and one 500kb file with a single native dependency?\n\n```sh\nnpm i -g microbundle-2\n# or\nnpx microbundle-2\n```\n\nThis is a reimplementation of [Microbundle](https://github.com/developit/microbundle)\nbuilt on [ESBuild](https://esbuild.github.io).\n\n\u003cimg width=\"1007\" alt=\"help\" src=\"https://github.com/user-attachments/assets/f6e3f477-bb7d-4188-8b4b-6ea7ca1a4d22\"\u003e\n\n\n## Simple Example\n\nYou write a package.json that looks like this:\n\n```jsonc\n{\n  \"name\": \"simple\",\n  \"type\": \"module\",\n  \"exports\": {\n\t\"import\": \"./dist/lib.js\",\n\t\"default\": \"./dist/lib.cjs\"\n  }\n}\n```\n\n\u003cimg width=\"251\" alt=\"simple example package\" src=\"https://github.com/user-attachments/assets/8c8b4b1e-aa43-4214-b4bb-4e32b5d856f9\"\u003e\n\n\n## Multiple entries\n\nJust define your package exports the way you already have to for Node/Vite/etc:\n\n```jsonc\n{\n  \"name\": \"multi-entry\",\n  \"type\": \"module\",\n  \"exports\": {\n    \".\": {\n      \"types\": \"./dist/lib.d.ts\",\n      \"import\": \"./dist/lib.js\",\n      \"default\": \"./dist/lib.cjs\"\n    },\n    \"./a\": {\n      \"types\": \"./dist/a.d.ts\",\n      \"import\": \"./dist/a.js\",\n      \"default\": \"./dist/a.cjs\"\n    },\n    \"./b\": {\n      \"types\": \"./dist/b.d.ts\",\n      \"import\": \"./dist/b.js\",\n      \"default\": \"./dist/b.cjs\"\n    }\n  }\n}\n```\n\n\u003cimg width=\"317\" alt=\"simple multi-entry package example\" src=\"https://github.com/user-attachments/assets/b2de4b6b-a13b-46c6-8940-f678de8b6ddf\"\u003e\n\nThis example has a dynamic import, which you can see produced a `./c` chunk. Both the ESM and CJS versions work the same way!\n\n## Wildcards/patterns\n\nWildcard/pattern exports are also supported:\n\n```jsonc\n{\n  \"name\": \"patterns\",\n  \"type\": \"module\",\n  \"exports\": {\n    \".\": {\n      \"types\": \"./build/index.d.ts\",\n      \"import\": \"./build/index.js\",\n      \"default\": \"./build/index.cjs\"\n    },\n    \"./lib/*\": {\n      \"types\": \"./build/lib/*.d.ts\",\n      \"import\": \"./build/lib/*.js\",\n      \"default\": \"./build/lib/*.cjs\"\n    },\n    \"./components/*\": {\n      \"source\": \"./lib/components/*.tsx\",\n      \"types\": \"./build/components/*.d.ts\",\n      \"import\": \"./build/components/*.js\",\n      \"default\": \"./build/components/*.cjs\"\n    }\n  }\n}\n```\n\n\u003cimg width=\"448\" alt=\"complex multi-entry example using wildcard/pattern exports\" src=\"https://github.com/user-attachments/assets/36bd84f8-8f1e-4e0d-8af9-970bd9f5c218\"\u003e\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopit%2Fmicrobundle-2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevelopit%2Fmicrobundle-2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopit%2Fmicrobundle-2/lists"}