@sentry/sveltekit bloats node_modules in a production build

未关闭
#25,215 2 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@chargome 已经在做这个了。

开始于 2026年10月9日。

评估

这个 Issue 还没有评估数据。

描述

Bug SvelteKit
Is there an existing issue for this?
How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/sveltekit

SDK Version

11.4.0

Framework Version

@sveltejs/kit 2.70.3

Link to Sentry event

No response

Reproduction Example/SDK Setup

https://stackblitz.com/edit/sveltejs-kit-template-default-zp5huzg7

@sveltejs/adapter-node requires node_modules (production dependencies only) to be deployed to the server. When using @sentry/sveltekit packages like @sentry/bundler-plugins end up on the server making deploys way bigger than needed. Is it possible to make the default behavior for @sentry/sveltekit being a dev dependency, and bundling only the needed node code to prevent dependency bloat? This would save ±130MB in the production deploy.

Real world example in my case is 208MB which could be 73MB by just ignoring @sentry/bundler-plugins in production installs. I'm already cheating by installing @sentry/node for production deps and @sentry/sveltekit only for dev deps.

Steps to Reproduce
  1. Setup SvelteKit app with @sveltejs/adapter-node
  2. Follow the @sentry/sveltekit setup steps
  3. Build app
  4. Clean npm production install (npm ci --omit dev)
  5. Inspect node_modules
Expected Result

Reasonable size of dependencies for compiled production applications.

Actual Result

130MB dependencies needed for compiling, not for running.

Additional Context

No response

Priority

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

主要语言
TypeScript
星标
8.8k
派生
1.9k
平均合并
1 天 8 小时
30 天内合并 PR
744

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

getsentry/sentry-javascript 的其他 Issue

查看 getsentry/sentry-javascript 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。