Miniflare supports both the traditional service-worker
and the newer modules
formats for writing workers. To use the modules
format, enable it with:
You can then use modules
worker scripts like the following:
Miniflare supports all module types: ESModule
, CommonJS
, Text
, Data
and
CompiledWasm
. You can specify additional module resolution rules as follows:
The following rules are automatically added to the end of your modules rules
list. You can override them by specifying rules matching the same globs
:
Thank you for helping improve Cloudflare's documentation!