How do you accomplish worker code splitting?
I'm trying to write a monolithic worker that handles multiple routes. I would like to dynamically import handler for each route using code splitting. Using the built-in wrangler bundling did not split the bundle at all. I tried building with vite for code splitting, and then using
no_bundle
, but wrangler will only upload the main chunk. I tried adding a rules
field to the wrangler.toml file, but it doesn't seem to have any effect. What am I missing?2 Replies
My wranger.toml looks like this:
+1 we also need this