You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on #10041, I realized that setting sourcemaps true in the vite config will set it to true for both client and server builds, which might not always be what you want. The client sourcemaps are left in the assets folder so they're accessible as any other asset without any restriction.
Describe the proposed solution
Something like config.kit.overrideClientSourcemaps: typeof vite_config.build.sourcemap and then set the value to overrideClientSourcemaps in the client build if present.
Alternatives considered
User deletes sourcemaps in the client folder after build
or #9544
Importance
nice to have
Additional Information
No response
The text was updated successfully, but these errors were encountered:
I want to share my perspective on this from the PoV of Sentry, where we need source maps to be present during the build.
(Read here as for why we need to upload users' source maps).
which might not always be what you want
I agree, it's not ideal that source maps are always generated for both, client and server, but this is how most bundlers and frameworks (e.g. NextJS) do it. I'm wondering if this is a necessary change after all.
Something like config.kit.overrideClientSourcemaps: typeof vite_config.build.sourcemap and then set the value to overrideClientSourcemaps in the client build if present.
So iiuc, this would be an opt-out option? Meaning, by default, if build: {sourcemap: true} is set, both client and server maps would be generated and only if kit.overrideClientSourcemaps would be set to false, client source maps would be omitted? If so, I think this is a fair solution. If it was opt-in, I would strongly argue against that.
The reason is that right now, our Vite plugin by default enables generation and uploading of source maps without users having to do any configuration manually (other than registering our plugin). Retaining this comfort with an opt-in mechanism in svelte.config.js would be close to impossible without serious (ugly) workarounds if possible at all.
User deletes sourcemaps in the client folder after build
This is basically what other frameworks also expect from users if they decide to generate source maps.
One thing I'm taking away from this issue (which definitely highlights valid concern) is that we should provide a better API from the Sentry SDK/Vite plugin side to delete source maps after we uploaded them, if it was our plugin that previously enabled them.
Describe the problem
While working on #10041, I realized that setting sourcemaps true in the vite config will set it to true for both client and server builds, which might not always be what you want. The client sourcemaps are left in the assets folder so they're accessible as any other asset without any restriction.
Describe the proposed solution
Something like
config.kit.overrideClientSourcemaps: typeof vite_config.build.sourcemap
and then set the value tooverrideClientSourcemaps
in the client build if present.Alternatives considered
User deletes sourcemaps in the client folder after build
or #9544
Importance
nice to have
Additional Information
No response
The text was updated successfully, but these errors were encountered: