getsentry / getsentry/sentry-javascript

[Next.js] Support setting different options for different runtimes (browser/server/edge)

未关闭
#13,837 6 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
Improvement Next.js
主要语言
TypeScript
星标
8.7k
派生
1.8k
平均合并
1 天 17 小时
30 天内合并 PR
515

描述

Originally posted by @ricardomatias [in discussions](https://github.com/getsentry/sentry-javascript/discussions/13833):

> I've removed the sentry.edge.config.ts and sentry.server.config.ts and I still get sourcemaps for both of them. I only want client sourcemaps.

I don't think this is possible right now without some very ugly hacks. We should provide some way of setting different options for the different runtimes.

Idea No.1 and probably my favorite: Allow for the `sentryBuildOptions` argument in `withSentryConfig` to be a function/callback that receives the runtime as an argument. (probably should pass it within an object so that we can extend it in the future)

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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