Ver Fonte

Adds a regex fix for the perf_hooks import in TS 4.1

Orta há 4 anos atrás
pai
commit
cc8da6b7fb
1 ficheiros alterados com 4 adições e 0 exclusões
  1. 4 0
      scripts/importTypescript.js

+ 4 - 0
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