Shakeskeyboarde
Shakeskeyboarde
CDCloudflare Developers
Created by Shakeskeyboarde on 3/26/2024 in #workers-help
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?
3 replies