@cloudflare/worker-bundler@0.2.0
cloudflare/agents@cloudflare/worker-bundler@0.2.0Jun 2, 2026by github-actions[bot]
AI Summary
This minor release adds a `virtualModules` option to `createWorker` that allows developers to provide virtual module sources during bundling. The feature supports import specifiers like `node:fs` or `virtual:app/config` and only works in bundle mode, being ignored with a warning in transform-only mode.
Key Highlights
- Added `virtualModules` option to `createWorker` for providing virtual module sources
- Supports import specifiers like `node:fs` and `virtual:app/config`
- Only applies when `bundle: true`; ignored with warning in transform-only mode
- Enables custom module resolution during the bundling process
New Features
- New `virtualModules` option that maps import specifiers to JavaScript module sources for bundling
Full Release Notes
### Minor Changes - [#1584](https://github.com/cloudflare/agents/pull/1584) [`87006e2`](https://github.com/cloudflare/agents/commit/87006e27498ee535feabd2a9bd207366f33621be) Thanks [@threepointone](https://github.com/threepointone)! - Add a `virtualModules` option to `createWorker`. Each key is an import specifier (for example `"node:fs"` or `"virtual:app/config"`) and each value is JavaScript module source made available during bundling. Only applies when `bundle: true`; in transform-only mode it is ignored with a warning.