How we rebuilt Cloudflare Workers’ module registry for Node.js compatibility
Cloudflare rewrote the Workers (workerd) module registry for Node.js-compatible URL-based module resolution, shipped behind the new_module_registry flag with a 64 MiB bundle limit.
Cloudflare rebuilt the module registry in workerd, the open-source Workers runtime, so module specifiers are resolved as URLs and ESM, CommonJS, and WebAssembly modules follow Node.js semantics. The change is enabled with the new_module_registry compatibility flag and adds import.meta.resolve(), require(esm), import attributes validation, lazy compilation, and cross-isolate cache sharing. It also lifts the compressed bundle size limit to 64 MiB on all plans; the legacy registry implementation remains available.
- New registry treats specifiers as real URLs, fixing import.meta.url and require(esm) behavior.
- Modules compile lazily and caches are shared across V8 isolates, improving performance.
- Compressed bundle limit raised to 64 MiB on all plans; opt-in via new_module_registry flag.
- Vendors
- Cloudflare
From the original article
10 min read at blog.cloudflare.com
Workers now enables Node. js compatibility by default, supports applications up to 64 mebibytes, and adds a URL-based module registry with import. meta, lazy compilation, shared code caches, and clearer errors.
By Logan Gatlin · blog.cloudflare.com
A short excerpt; the article and its images belong to the publisher. Summary, key facts and assessment above are AI-written from the article and can be wrong.