Skip to content

feat(nuxt): Align build-time options to follow bundler plugins structure #17255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 1, 2025

Conversation

s1gr1d
Copy link
Member

@s1gr1d s1gr1d commented Jul 31, 2025

Aligns the build-time options of the Nuxt SDK and implements the missing options.

Closes #17064

@s1gr1d s1gr1d requested review from andreiborza and Lms24 July 31, 2025 12:06
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

/**
* When an error occurs during release creation or sourcemaps upload, the plugin will call this function.
*
* By default, the plugin will simply throw an error, thereby stopping the bundling process.
Copy link
Member

Choose a reason for hiding this comment

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

Unless I'm mistaken, by default the plugin fails gracefully by printing the error but not exiting the build process.

Copy link
Member Author

Choose a reason for hiding this comment

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

The docs are taken from here: https://www.npmjs.com/package/@sentry/vite-plugin#errorhandler

If this is not correct, we should also fix it in the bundler-plugins readme.

Comment on lines +190 to +205
org: moduleOptions.org ?? sourceMapsUploadOptions.org ?? process.env.SENTRY_ORG,
// eslint-disable-next-line deprecation/deprecation
project: moduleOptions.project ?? sourceMapsUploadOptions.project ?? process.env.SENTRY_PROJECT,
// eslint-disable-next-line deprecation/deprecation
authToken: moduleOptions.authToken ?? sourceMapsUploadOptions.authToken ?? process.env.SENTRY_AUTH_TOKEN,
// eslint-disable-next-line deprecation/deprecation
telemetry: moduleOptions.telemetry ?? sourceMapsUploadOptions.telemetry ?? true,
// eslint-disable-next-line deprecation/deprecation
url: moduleOptions.sentryUrl ?? sourceMapsUploadOptions.url ?? process.env.SENTRY_URL,
headers: moduleOptions.headers,
debug: moduleOptions.debug ?? false,
silent: sourceMapsUploadOptions.silent ?? false,
errorHandler: sourceMapsUploadOptions.errorHandler,
// eslint-disable-next-line deprecation/deprecation
silent: moduleOptions.silent ?? sourceMapsUploadOptions.silent ?? false,
// eslint-disable-next-line deprecation/deprecation
errorHandler: moduleOptions.errorHandler ?? sourceMapsUploadOptions.errorHandler,
bundleSizeOptimizations: moduleOptions.bundleSizeOptimizations, // todo: test if this can be overridden by the user
Copy link
Member

Choose a reason for hiding this comment

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

l/just to confirm: Did we settle on the new build time options taking precedence over the old ones? I think this is generally fine (as fine as vice versa) but let's make sure we're consistent with this behaviour across sdks. (also doesn't hurt to write it down in the issue).

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah we didn't specifically talk about that but I thought it makes sense as it makes migration easier as well. I'll write it down 👍

@@ -0,0 +1,129 @@
import { describe, expectTypeOf, it } from 'vitest';
Copy link
Member

Choose a reason for hiding this comment

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

huh TIL about expectTypeOf 😅

@s1gr1d s1gr1d merged commit aa4547c into develop Aug 1, 2025
182 checks passed
@s1gr1d s1gr1d deleted the sig/nuxt-buildTimeOptions branch August 1, 2025 11:51
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]: Align build-time bundler plugin options
2 participants