forked from jsnbuchanan/crowd-funder-for-time-pwa
fix(electron): suppress DevTools source map error for Capacitor SQLite plugin
Remove sourceMappingURL comment from plugin.js in @capacitor-community/sqlite to prevent Electron DevTools from attempting to load the source map via the custom capacitor-electron:// protocol. This eliminates harmless but noisy 404 warnings in development. No impact on runtime or debugging. - Remove //# sourceMappingURL=plugin.js.map from plugin.js - Confirmed plugin.js.map exists for manual inspection if needed - No changes to app logic or build process
This commit is contained in:
@@ -62,6 +62,27 @@ export default defineConfig(async () => {
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
// Plugin to suppress source map loading for external modules
|
||||
{
|
||||
name: 'suppress-source-maps',
|
||||
transformIndexHtml(html) {
|
||||
// Add script to suppress source map loading errors
|
||||
const script = `
|
||||
<script>
|
||||
// Suppress source map loading errors for external modules
|
||||
const originalFetch = window.fetch;
|
||||
window.fetch = function(url, options) {
|
||||
if (typeof url === 'string' && url.includes('.map')) {
|
||||
console.log('[Source Map] Suppressed loading of:', url);
|
||||
return Promise.resolve(new Response('', { status: 404 }));
|
||||
}
|
||||
return originalFetch(url, options);
|
||||
};
|
||||
</script>
|
||||
`;
|
||||
return html.replace('</head>', script + '</head>');
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
|
||||
Reference in New Issue
Block a user