From cc8da6b7fb863b62acbd8c65e932b56f494c1a76 Mon Sep 17 00:00:00 2001 From: Orta Date: Mon, 26 Oct 2020 11:46:28 -0400 Subject: [PATCH] Adds a regex fix for the perf_hooks import in TS 4.1 --- scripts/importTypescript.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/importTypescript.js b/scripts/importTypescript.js index c5466e95..b70b0cfb 100644 --- a/scripts/importTypescript.js +++ b/scripts/importTypescript.js @@ -62,6 +62,10 @@ export const typescriptVersion = "${typeScriptDependencyVersion}";\n` /^( +)debugger;$/m, '$1// MONACOCHANGE\n$1// debugger;\n$1// END MONACOCHANGE' ); + tsServices = tsServices.replace( + /= require\("perf_hooks"\)/m, + '/* MONACOCHANGE */= {}/* 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