Edge Computing with Cloudflare Workers
JavaScript modules are now supported on Cloudflare Workers

JavaScript modules are now supported on Cloudflare Workers

11/16/2021 · Ashcon Partovi

What this post added

This post introduces support for JavaScript modules (ECMAScript modules) in Cloudflare Workers. This allows for standard import/export syntax, improving code organization and reusability. It also introduces a new event handler syntax for module workers, spreading event parameters like `request` and `environment` for better security and clarity. The post also details how to import WebAssembly, text, and binary modules, and provides guidance on using the new module format with Wrangler 2.0 and existing projects with Wrangler 1.0.

Read the original post ↗