From 9eb8d97d2ec67394bb341b01852fd2a29096e7c5 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Fri, 29 Nov 2024 12:36:20 +0000 Subject: [PATCH] solidstart --- packages/solidstart/src/vite/sourceMaps.ts | 23 +++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/packages/solidstart/src/vite/sourceMaps.ts b/packages/solidstart/src/vite/sourceMaps.ts index cd7c76db6c6d..b6923b9d86b6 100644 --- a/packages/solidstart/src/vite/sourceMaps.ts +++ b/packages/solidstart/src/vite/sourceMaps.ts @@ -15,17 +15,22 @@ export function makeSourceMapsVitePlugin(options: SentrySolidStartPluginOptions) apply: 'build', enforce: 'post', config(config) { - const sourceMapsPreviouslyNotEnabled = !config.build?.sourcemap; - if (debug && sourceMapsPreviouslyNotEnabled) { + // TODO(v9): Remove this warning + if (config.build?.sourcemap === false) { // eslint-disable-next-line no-console - console.log('[Sentry SolidStart Plugin] Enabling source map generation'); - if (!sourceMapsUploadOptions?.filesToDeleteAfterUpload) { - // eslint-disable-next-line no-console - console.warn( - '[Sentry SolidStart PLugin] We recommend setting the `sourceMapsUploadOptions.filesToDeleteAfterUpload` option to clean up source maps after uploading. Otherwise, source maps might be deployed to production, depending on your configuration. In future versions the SDK will default to deleting sourcemaps after uploading them.', - ); - } + console.warn( + "[Sentry SolidStart PLugin] You disabled sourcemaps with the `build.sourcemap` option. Currently, the Sentry SDK will override this option to generate sourcemaps. In future versions, the Sentry SDK will not override the `build.sourcemap` option if you explicitly disable it. If you want to generate and upload sourcemaps please set the `build.sourcemap` option to 'hidden' or undefined.", + ); } + + // TODO(v9): Remove this warning and print warning in case source map deletion is auto configured + if (!sourceMapsUploadOptions?.filesToDeleteAfterUpload) { + // eslint-disable-next-line no-console + console.warn( + "[Sentry SolidStart PLugin] The Sentry SDK has enabled source map generation for your SolidStart app. If you don't want to serve Source Maps to your users, either configure the `filesToDeleteAfterUpload` option with a glob to remove source maps after uploading them, or manually delete the source maps after the build. In future Sentry SDK versions source maps will be deleted automatically after uploading them.", + ); + } + return { ...config, build: {