`wrangler pages dev` appears to not be performing a tree shake of the SVG's in my icon library.

I'm using svelte-kit with the pages adapter. I also imported a VERY big SVG icon library called 'lucid-svelte' which promises to tree shake unused SVG dependencies. When I npm run build all appears to be fine with a dev server. I also deployed project to cloudflare with wrangler pages deploy and all appears to work well in that environment. My issue is when I run npm run build and then wrangler pages dev on the project, the build appears to work, and the dev server is spun up, but when I make a request to the dev server, the request hangs for more than 60 seconds, and then after it responds, the requests come through quickly. When I remove this SVG library the problems go away with wranger pages dev.
1 Reply
James
James4mo ago
Tree-shaking generally isn't something that happens in development. Is there perhaps another way you can import the icons that doesn't pull them all in?
Want results from more Discord servers?
Add your server