getsentry / getsentry/sentry-javascript

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

Ouverte
#18,974 1 commentaire 0 réactions 1 personne assignée Réclamée par @s1gr1d Voir sur GitHub
Nuxt Task
Langage dominant
TypeScript
Étoiles
8.7k
Forks
1.8k
Merge moyen
1 j 17 h
PR mergées (30 j)
515

Description

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

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.