Skip to content

Commit c53b4e9

Browse files
authored
fix: skip log-source-maps for large files (#5780)
1 parent 3d5891a commit c53b4e9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/services/log-source-map-service.ts

+9
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,15 @@ export class LogSourceMapService implements Mobile.ILogSourceMapService {
6969
if (!this.$fs.getFsStats(filePath).isDirectory()) {
7070
const mapFile = filePath + ".map";
7171
let sourceMapRaw;
72+
73+
// Skip files bigger than 50MB
74+
if (this.$fs.getFileSize(filePath) > 50 * 1000 * 1000) {
75+
this.$logger.trace(
76+
`Skipping source map for file ${filePath} because it is too big (> 50MB).`
77+
);
78+
return;
79+
}
80+
7281
const source = this.$fs.readText(filePath);
7382
if (this.$fs.exists(mapFile)) {
7483
sourceMapRaw = sourceMapConverter.fromMapFileSource(

0 commit comments

Comments
 (0)