Fixes #2815: Remove require reference in typescriptServices

This commit is contained in:
Alexandru Dima 2021-12-14 16:55:59 +01:00
parent 10251b81a0
commit ad4a942460
No known key found for this signature in database
GPG key ID: 39563C1504FDD0C9
3 changed files with 6 additions and 2 deletions

View file

@ -69,6 +69,10 @@ export const typescriptVersion = "${typeScriptDependencyVersion}";\n`
/= require\("perf_hooks"\)/m,
'/* MONACOCHANGE */= {}/* END MONACOCHANGE */'
);
tsServices = tsServices.replace(
/typeof require === "function"/m,
'/* MONACOCHANGE */false/* END MONACOCHANGE */'
);
// Flag any new require calls (outside comments) so they can be corrected preemptively.
// To avoid missing cases (or using an even more complex regex), temporarily remove comments