Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Latest commit

 

History

History
9 lines (6 loc) · 516 Bytes

File metadata and controls

9 lines (6 loc) · 516 Bytes

worker-with-dependencies

Cloudflare workers support all Node.js packages that are bundled with webpack or any other polyfill bundler (https://blog.cloudflare.com/node-js-support-cloudflare-workers/)

Notes:

  1. Installing a package is as normal as using the common npm syntax (npm install <dep>)
  2. If the dependency depends on Node.js native builtins, the node_compat = true config needs to be included in wrangler.toml
  3. Importing a package is done using the ESM syntax (import {...} from '<dep>')