Closed jhubbardsf closed 1 year ago
It wouldn't shock me if this is because @playwright/test
doesn't have sideEffects: false
in its package.json
. Rollup doesn't know it's side-effect free, so it doesn't strip it. You could test this by adding that key to its package.json
in node_modules
and then building.
I believe this is working as intended and you can modify the behavior with: https://rollupjs.org/configuration-options/#treeshake-modulesideeffects
Describe the bug
I was helping a friend debug their app and Vercel started complaining that the build was exceeding the 50MB Serverless Function limitation it has. The error ended up being that an intern had accidentally imported
import { request } from '@playwright/test';
into a +server.ts API route which bloated the function beyond the 50MB limit because of how large that package is. But here's my confusion:The intern had accidentally imported it and then not even used it. It was my understanding that an unused import like that would be stripped from the build (and a local
pnpm build
, and looking at the file sizes, seems to back that up). So is this a misunderstanding of what SvelteKit does on my part, a problem with the Vercel-Adapter, or something else possibly going on?Reproduction
Sadly can't fork and show the repo since it's proprietary work but if my explanation isn't enough I can try to recreate it in a new repo.
Logs
No response
System Info
Severity
serious, but I can work around it
Additional Information
No response