{"id":19636863,"url":"https://github.com/mizchi/bundler","last_synced_at":"2025-04-28T09:31:17.527Z","repository":{"id":40765769,"uuid":"269629818","full_name":"mizchi/bundler","owner":"mizchi","description":"hobby bundler","archived":false,"fork":false,"pushed_at":"2023-01-07T18:51:01.000Z","size":519,"stargazers_count":5,"open_issues_count":29,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T08:04:00.573Z","etag":null,"topics":["bundler","rollup","webpack"],"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/mizchi.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}},"created_at":"2020-06-05T12:33:38.000Z","updated_at":"2023-05-01T08:49:09.000Z","dependencies_parsed_at":"2023-02-07T21:31:12.282Z","dependency_job_id":null,"html_url":"https://github.com/mizchi/bundler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizchi%2Fbundler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizchi%2Fbundler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizchi%2Fbundler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizchi%2Fbundler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mizchi","download_url":"https://codeload.github.com/mizchi/bundler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251284876,"owners_count":21564687,"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":["bundler","rollup","webpack"],"created_at":"2024-11-11T12:31:52.523Z","updated_at":"2025-04-28T09:31:12.498Z","avatar_url":"https://github.com/mizchi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @mizchi/bundler\n\nMy hobby bundler like webpack/rollup. Do not use production.\n\n## Features\n\n- Run universal\n- Modern JS(ES2019) Target\n- only handle ESM\n- readable output(but loose)\n- treeshake\n\n## Example\n\n```ts\nimport { Bundler } from \"@mizchi/bundler\";\nimport { format } from \"prettier\"; // install yourself\nconst fileMap = {\n  \"/foo.js\": \"export default 1;\",\n  \"/index.js\": `import foo from \"./foo.js\"; console.log(foo); export const index = 1;`,\n};\nconst bundler = new Bundler(fileMap);\n(async () =\u003e {\n  const code = await bundler.bundle(\"/index.js\", { optimize: true });\n  console.log(format(code, { parser: \"babel\" }));\n})();\n```\n\noutput\n\n```ts\n// @mizchi/bundler generate\nconst _$_exported = {};\nconst _$_import = (id) =\u003e\n  _$_exported[id] || _$_modules[id]((_$_exported[id] = {}));\nconst _$_modules = {\n  \"/foo.js\": (_$_exports) =\u003e {\n    _$_exports.default = 1;\n    return _$_exports;\n  },\n};\n// -- entry --\n\nconst { default: foo } = _$_import(\"/foo.js\");\n\nconsole.log(foo);\nexport const index = 1;\n```\n\nEntry exports are left.\n\n## Example: chunks\n\nWIP\n\n## Example: Worker\n\nWIP\n\n## TODO\n\n- [x] Delete build cache and rebuild\n- [x] `import \"./xxx\";`\n- [x] `export const a = 1;`\n- [x] Tree shaking\n  - [x] Detect side effects\n  - [x] Strip unused import\n  - [x] Remove modules code by treeshake\n  - [x] Remove unused exports\n- [x] Dynamic import chunks: `bundler.bundleChunks(entry)`\n- [x] publicPath\n- [x] Bundle for worker\n- [x] `export { a }`\n- [x] `export { a } from \"./b\"`\n- [x] `export { a as x} from \"./b\"`\n- [x] Entry: `export {...}`;\n- [x] Module: `export * as x from ...`\n- [ ] Entry: `export {...} from ...`\n\n## Dynamic library features\n\n- [x] Skip import and export those are not relative\n- [x] Support import-map\n- [x] Use with snowpack\n- [ ] name resolver on `preservedExternalImports` and `Worker`\n- [ ] Rewrite to pikacdn options\n- [ ] File watcher with node\n- [ ] Support tsx\n- [ ] Node fs/promises\n\n## Icebox\n\n- [ ] Inline Worker\n- [ ] minilink integration\n- [ ] compile to single html\n\n## LICENSE\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmizchi%2Fbundler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmizchi%2Fbundler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmizchi%2Fbundler/lists"}