Skip to content

Template for modules, webpack, commonjs

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE_APACHE
MIT
LICENSE_MIT
Notifications You must be signed in to change notification settings

cloudflare/modules-webpack-commonjs

👷 Modules Wrangler template

NOTE: You must be using wrangler 1.16 or newer to use this template

A template for kick starting a Cloudflare Workers project using:

  • Modules (CommonJS modules to be specific)
  • Webpack
  • Wrangler

Worker code is in src/index.js

Webpack is configured to output a bundled CommonJS module to dist/index.js

This project uses a shim ES module at src/shim.mjs that imports the commonjs bundle, and re-exports it. This is necessary because commonjs does not support named exports, and the only way to export a durable object class is using named exports.

  • This shim is also configured to be the main module, using the module key in package.json.

About

Template for modules, webpack, commonjs

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE_APACHE
MIT
LICENSE_MIT

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published