Change to better bundler
konhi opened this issue · 1 comments
konhi commented
I suggest changing the default bundler from webpack to something different, such as esbuild or swc. I moved to esbuild, and instantly noticed
- surprising build times while developing with
wrangler dev
🥰 - support for Module Workers (webpack doesn't seem to support for
export
, correct me if I'm wrong) - Cloudflare advises to use it, as it gives few advantages including support for Durable Objects
Example template is shown there: https://github.com/codewithkristian/esbuild-typescript-modules-workers-template
JacobMGEvans commented
This example is now using Wrangler2 and has it as a dependency which utilizes ESBuild currently.