-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Conversation
/** | ||
* 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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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 |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
huh TIL about expectTypeOf
😅
Aligns the build-time options of the Nuxt SDK and implements the missing options.
Closes #17064