-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Temporary sourcemaps support #12828
Comments
With the generateBundle(_, bundle) {
for (const file in bundle) {
if (file.endsWith('.map')) {
delete bundle[file]
}
}
} |
@bluwy Thanks, this looks better than manual removing, but is'nt that solution strips out sourcemaps before next plugin run? My idea was to provide generated sourcemaps to each plugin, no matter in which order it was added, and delete them at bundling finish. |
You can use |
But it is - multiple plugins can use same technique with enforce and order usage. My initial request was about providing some safe way to use sourcemaps in multiple plugins while building, without worrying of their ordering or internal implementation. Like adding |
We won't add a new option if it can already be achieved by a plugin. There are more plugins that do a lot more similar stuff, and it had worked so far, so it's not an issue. |
Yes, this can be achieved at plugin level, but this is requiring from user to strongly follow plugins order and enable sourcemap deletion only for last one. Anyway i got you, seems like better solution for now is to recommend users to use separate sourcemap remover plugin |
Description
As a developer of vite-plugin-sentry i've seen many feature requests from users to add option to delete sourcemaps after they become uploaded to external service (Sentry in my case). issue
While there are exist some workarounds, i think better solution would control sourcemaps generation and cleaning processes at Vite level.
Suggested solution
I think it would be perfect to have some option to generate sourcemaps temporary.
When
sourcemapTemporary
is false - there are no any changes in Vite behavior.When
sourcemapTemporary
is true - Vite runs as always. At the end of bundling process, Vite removes generated sourcemaps (option is ignored if sourcemap was false).Alternative
For now there are several possible workarounds (from better to worst):
vite build && rimraf dist/**/*.map
)Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: