-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Limited Source map generation #19187
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
Comments
I'm not talkign about I'm talking about reducing the filesize of the sourcemap file itself by REMOVING that information. One solution from source map:
|
There was a related discussion about avoid generating source maps for node_modules #17923 (comment). I think this is somewhat possible from a plugin by manipulating mappings for selected files. Here is an example to force empty mappings for some files https://stackblitz.com/edit/vitejs-vite-xxt3g3ph?file=vite.config.ts (it should be tested locally as stackblitz's browser source map seems not working). export default defineConfig({
build: {
sourcemap: true,
},
plugins: [
{
name: 'remove-source-map',
enforce: 'post',
transform(code, id, options) {
if (id.endsWith('b.js')) {
return { code, map: { mappings: '' } };
}
},
},
],
}); |
Closing this request in favor of #19365 as other proposal is more concise. |
Description
This is related to #19186 (as an alternative solution to that proposal).
Source Maps are too large for analysis in production during production. (I know it's not the normal way)
Vite should have an option to generate a very limited source map.
The ability for it to record ONLY the original filename of files in a limited set of directories. (No line numbers, character positions etc).
The intention is to analyse stack traces.
Suggested solution
Limited Source maps
Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: