getsentry / getsentry/sentry-javascript

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

Abierto
#18,974 1 comentario 0 reacciones 1 asignado Reclamado por @s1gr1d Ver en GitHub
Nuxt Task
Lenguaje dominante
TypeScript
Estrellas
8.7k
Forks
1.8k
Merge medio
1 d 17 h
PR fusionados (30 d)
515

Descripción

### 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.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.