Skip to content

Comments

ref(nuxt): Use addVitePlugin instead of deprecated vite:extendConfig#19464

Open
s1gr1d wants to merge 4 commits intodevelopfrom
sig/nuxt-vite-config
Open

ref(nuxt): Use addVitePlugin instead of deprecated vite:extendConfig#19464
s1gr1d wants to merge 4 commits intodevelopfrom
sig/nuxt-vite-config

Conversation

@s1gr1d
Copy link
Member

@s1gr1d s1gr1d commented Feb 23, 2026

vite:extendConfig is deprecated, so source maps handling will be done in a plugin which is added with addVitePlugin from Nuxt.

Also updated the existing tests so they can test the new plugin functionality.

Closes #19345

@s1gr1d s1gr1d changed the title ref(nuxt): Use addVitePlugin instead of deprecated vite:extendConfig ref(nuxt): Use addVitePlugin instead of deprecated vite:extendConfig Feb 23, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 23, 2026

size-limit report 📦

Path Size % Change Change
@sentry/browser 25.62 kB - -
@sentry/browser - with treeshaking flags 24.12 kB - -
@sentry/browser (incl. Tracing) 42.42 kB - -
@sentry/browser (incl. Tracing, Profiling) 47.09 kB - -
@sentry/browser (incl. Tracing, Replay) 81.24 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 70.86 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 85.94 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 98.2 kB - -
@sentry/browser (incl. Feedback) 42.43 kB - -
@sentry/browser (incl. sendFeedback) 30.29 kB - -
@sentry/browser (incl. FeedbackAsync) 35.34 kB - -
@sentry/browser (incl. Metrics) 26.79 kB - -
@sentry/browser (incl. Logs) 26.93 kB - -
@sentry/browser (incl. Metrics & Logs) 27.61 kB - -
@sentry/react 27.37 kB - -
@sentry/react (incl. Tracing) 44.76 kB - -
@sentry/vue 30.07 kB - -
@sentry/vue (incl. Tracing) 44.27 kB - -
@sentry/svelte 25.64 kB - -
CDN Bundle 28.16 kB - -
CDN Bundle (incl. Tracing) 43.25 kB - -
CDN Bundle (incl. Logs, Metrics) 29 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 44.09 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 68.08 kB - -
CDN Bundle (incl. Tracing, Replay) 80.13 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 81 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 85.65 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 86.53 kB - -
CDN Bundle - uncompressed 82.34 kB - -
CDN Bundle (incl. Tracing) - uncompressed 128.06 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 85.18 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 130.89 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 208.84 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 244.94 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 247.76 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 257.85 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 260.66 kB - -
@sentry/nextjs (client) 47.17 kB - -
@sentry/sveltekit (client) 42.89 kB - -
@sentry/node-core 52.18 kB +0.02% +8 B 🔺
@sentry/node 173.45 kB +0.01% +9 B 🔺
@sentry/node - without tracing 97.33 kB +0.02% +10 B 🔺
@sentry/aws-serverless 113.13 kB +0.01% +7 B 🔺

View base workflow run

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

}),
// Only add source map plugin during build
{ dev: false, build: true },
);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale shouldDeleteFilesFallback reference in Vite plugin

High Severity

shouldDeleteFilesFallback is initialized as { client: true, server: true } with let, then reassigned to a new object inside the modules:done hook. However, createSentryViteConfigPlugin is called synchronously before modules:done fires, so it captures a reference to the initial object. When modules:done later reassigns the variable to a new object, the plugin still holds the stale { client: true, server: true } reference. This causes the Vite plugin to always configure fallback source map file deletion, even when users explicitly enabled source maps (where it should be { client: false, server: false }). The old vite:extendConfig hook used a closure reading the variable lazily, so it correctly saw the updated value. The nitro:config hook still works correctly for the same reason.

Additional Locations (2)

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Nuxt] Change nuxt.hook usage to Vite config hook

1 participant