{"id":19904345,"url":"https://github.com/alloc/cloudflare-bundler","last_synced_at":"2025-05-03T00:31:36.554Z","repository":{"id":57200737,"uuid":"326478020","full_name":"alloc/cloudflare-bundler","owner":"alloc","description":"Prepare a worker for Cloudflare deployment","archived":true,"fork":false,"pushed_at":"2021-01-23T16:33:46.000Z","size":131,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T12:50:14.519Z","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/alloc.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}},"created_at":"2021-01-03T18:49:05.000Z","updated_at":"2024-11-11T17:00:09.000Z","dependencies_parsed_at":"2022-09-16T15:12:04.262Z","dependency_job_id":null,"html_url":"https://github.com/alloc/cloudflare-bundler","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloc%2Fcloudflare-bundler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloc%2Fcloudflare-bundler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloc%2Fcloudflare-bundler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloc%2Fcloudflare-bundler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alloc","download_url":"https://codeload.github.com/alloc/cloudflare-bundler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252126559,"owners_count":21698964,"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-11-12T20:27:58.860Z","updated_at":"2025-05-03T00:31:35.874Z","avatar_url":"https://github.com/alloc.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cloudflare-bundler\n\nGenerate a bundle that runs as a [Cloudflare worker][1], then upload it to Cloudflare.\n\nThe bundle is minified by default.\n\n[1]: https://developers.cloudflare.com/workers/\n\n```ts\nconst { bundleWorker } = require('cloudflare-bundler')\n\n// Bundle the worker, then upload to Cloudflare.\nconst worker = await bundleWorker({\n  main: 'workers/foo.ts',\n  upload: true,\n})\n\n// Write the sourcemap.\nconst fs = require('fs')\nfs.writeFileSync(\n  'workers/foo.js.map',\n  JSON.stringify(worker.map)\n)\n```\n\n### Install\n\n```sh\nyarn add -D cloudflare-bundler\n```\n\n### Options\n\n- `main?: string`  \n  The entry module in JavaScript or TypeScript.\n\n- `root?: string`  \n  The root directory of the worker.  \n\n  This option is useful when your worker has its own `package.json` and \n  `worker.toml` files. The `main` option is inferred from its `package.json` \n  file, and the `upload` option is inferred from its `worker.toml` file.  \n\n  If `main` is undefined, this option is required.\n\n- `plugins?: RollupPlugin[]`  \n  Custom plugins to apply after the default plugins (but before minifying).\n\n- `serveGlobs?: string[] | { [root: string]: string[] }`  \n  Matching files are bundled with the script. Use the `serve` function (exported\n  by this plugin) in your script to easily serve the bundled content with the\n  proper response headers (`ETag`, `Content-Type`, `Content-Length`).  \n\n  When an array is passed, the globs are relative to the `root` option (or\n  the working directory if `root` is undefined).\n\n- `minify?: object | boolean`  \n  Customize how the script is minified, or pass `false` to disable minification.\n\n- `minifyHtml?: object | boolean`  \n  Customize how inlined `.html` modules are minified, or pass `false` to disable.\n\n- `upload?: UploadConfig`  \n  When defined, the worker is uploaded after a successful build.  \n  \n  The `UploadConfig` type contains these values:  \n    - `scriptId: string` (any name you like)\n    - `accountId: string` (found on the homepage of your Cloudflare account)\n    - `authToken?: string` (defaults to `process.env.CLOUDFLARE_AUTH_TOKEN`)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falloc%2Fcloudflare-bundler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falloc%2Fcloudflare-bundler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falloc%2Fcloudflare-bundler/lists"}