getsentry / getsentry/sentry-javascript

[Nuxt] Inject debug IDs and release only at build-end

Đang mở
#18,974 1 bình luận 0 reaction 1 người được giao Được @s1gr1d nhận Xem trên GitHub
Nuxt Task
Ngôn ngữ chính
TypeScript
Star
8.7k
Fork
1.8k
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
515

Mô tả

### Description

## Problem
Nuxt runs through the build twice (client and server).
1. Nuxt builds client-side
2. Nuxt builds server-side
3. Now all client and server files in `.nuxt/dist` contain one debug ID
4. Nitro builds server-side
5. The whole build output is moved to `.output` and the server-side files which were already included in `.nuxt/dist/server` (the Nuxt build) are touched by the rollup plugin a second time.

This setup causes the Nuxt SDK to include the Vite **and** the Rollup plugin, so all source map files are uploaded. However, this has some drawbacks:
- build-times are longer (as there are more uploads during the build)
- Source-mapping might cause problems because some files are touched twice (by Nuxt and Nitro) ([related issue](https://github.com/getsentry/sentry-javascript/issues/18519) - however, this was fixed with a workaround that checks if a file already contains a debug ID)
- release injection happens twice in some files

## Solution
By using the [Bundler Plugin Manager](https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/main/packages/bundler-plugin-core/src/build-plugin-manager.ts), we can do everything (debug
ID and release injection) at the end of the build.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.