{"id":19495305,"url":"https://github.com/kat-tax/syn","last_synced_at":"2026-05-06T17:36:07.088Z","repository":{"id":219634191,"uuid":"732994273","full_name":"kat-tax/syn","owner":"kat-tax","description":"The Bundler for Browsers","archived":false,"fork":false,"pushed_at":"2024-01-28T22:48:59.000Z","size":34,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-25T08:47:30.068Z","etag":null,"topics":["browser-bundler","bundler","cloudflare-workers","deno","esbuild","esbuild-wasm","wasm"],"latest_commit_sha":null,"homepage":"https://syn.ult.dev","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/kat-tax.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}},"created_at":"2023-12-18T10:24:36.000Z","updated_at":"2025-04-12T02:53:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"ba3aa79b-8478-45c6-be8a-b31860df2e14","html_url":"https://github.com/kat-tax/syn","commit_stats":null,"previous_names":["kat-tax/syn"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kat-tax/syn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kat-tax%2Fsyn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kat-tax%2Fsyn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kat-tax%2Fsyn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kat-tax%2Fsyn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kat-tax","download_url":"https://codeload.github.com/kat-tax/syn/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kat-tax%2Fsyn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32704743,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T08:33:17.875Z","status":"ssl_error","status_checked_at":"2026-05-06T08:33:17.221Z","response_time":117,"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":["browser-bundler","bundler","cloudflare-workers","deno","esbuild","esbuild-wasm","wasm"],"created_at":"2024-11-10T21:36:54.810Z","updated_at":"2026-05-06T17:36:07.072Z","avatar_url":"https://github.com/kat-tax.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SYN\n\n\u003e The Web Bundler for Web Environments\n\nDefinition:\n```ts\n/**\n * Bundle a React application\n * @param entry Path to the app entry point (e.g. /index.tsx)\n * @param files Virtual File System containing files needed to bundle the app\n * @param config ESBuild config https://esbuild.github.io/api/#bundle\n * @param importMap The import map used to determine external dependencies\n * @returns a string containing the bundled application code\n */\nexport async function bundle(\n  entry: string,\n  files: Map\u003cstring, string | Uint8Array\u003e,\n  config?: BuildOptions,\n  importMap?: Record\u003cstring, string\u003e,\n): Promise\u003cstring\u003e {\n\n  const resolver = new Resolver(files);\n  const compiler = new Compiler();\n\n  return await compiler.compile(entry, {\n    define: {'process.env.NODE_ENV': '\"development\"'},\n    inject: ['import-react'],\n    jsx: 'automatic',\n    target: 'esnext',\n    format: 'esm',\n    jsxDev: true,\n    ...config,\n  }, [\n    png({resolver}),\n    svg({resolver}),\n    css({resolver}),\n    react({resolver, importMap}),\n  ]);\n}\n```\n\nUsage:\n```ts\n// Import bundler\nimport {bundle} from 'syn-bundler';\n\n// Create a Virtual File System\nconst files: Map\u003cstring, string | Uint8Array\u003e = new Map();\n\n// Add code to VFS\nfor (const [name, component] of Object.entries(components)) {\n  files.set(`/components/${name}`, component.code);\n}\n\n// Add assets to VFS\nfor (const [name, asset] of Object.entries(assets)) {\n  const extension = asset.isVector ? 'svg' : 'png';\n  const folder = asset.isVector ? 'vectors' : 'rasters';\n  const path = `/assets/${folder}/${name}.${extension}`;\n  files.set(path, asset.bytes);\n}\n\n// Add entrypoint to VFS\nfiles.set('/index.tsx', mainComponent);\n\n// Bundle VFS\nconst output = await bundle('/index.tsx', files);\n\n// Print string output (or render in iframe)\nconsole.log(output);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkat-tax%2Fsyn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkat-tax%2Fsyn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkat-tax%2Fsyn/lists"}