client: fix sourcemaps (stacktrace-js doesn't like when sourcecode is included in maps, good news for file size!)

This commit is contained in:
jean-emmanuel 2025-09-24 08:21:49 +02:00
parent af2a771b7d
commit 96f5cd0cf5
2 changed files with 2 additions and 11 deletions

View file

@ -19,6 +19,7 @@ module.exports = {
entryFileNames: `[name]-${package.version}.js`,
format: 'es',
sourcemap: true,
sourcemapExcludeSources: true
},
],
treeshake: false,

View file

@ -10,17 +10,7 @@ window.onerror = function(msg,url,row,col, error) {
StackTrace.fromError(error).then((stackframes)=>{
var stringifiedStack = stackframes.filter((sf)=>{
return !sf.fileName.match('browser-pack')
}).map(function(sf) {
if (sf.functionName.match(/Object\./)) sf.functionName = 'require'
return ` at ${sf.functionName} (${sf.fileName}:${sf.lineNumber}:${sf.columnNumber})`
}).join('\n')
var stringifiedStack = stackframes.join('\n')
uiConsole.log('error', `${msg}\n${stringifiedStack}`)
ipc.send('errorLog', `(ERROR, CLIENT) ${msg}\n${stringifiedStack}`)