refactor(localize): avoid computing source-maps in extraction unnecessarily (#40891)
Previously we were calling `updateSourceLocations()` as part of `extractMessages()` for every file that was passed in, regardless of whether any `$localize` tagged strings were to be found in the file. This was very wasteful because it is non-trivial to compute the flattened source-map for files if it is not needed. PR Close #40891
This commit is contained in:
parent
bafab6de79
commit
f57cd19e0c
@ -58,9 +58,9 @@ export class MessageExtractor {
|
|||||||
code: false,
|
code: false,
|
||||||
ast: false
|
ast: false
|
||||||
});
|
});
|
||||||
}
|
if (this.useSourceMaps && messages.length > 0) {
|
||||||
if (this.useSourceMaps) {
|
this.updateSourceLocations(filename, sourceCode, messages);
|
||||||
this.updateSourceLocations(filename, sourceCode, messages);
|
}
|
||||||
}
|
}
|
||||||
return messages;
|
return messages;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user