Fixes #2815: Remove `require` reference in `typescriptServices`

pull/2828/head
Alexandru Dima 3 years ago
parent 10251b81a0
commit ad4a942460
No known key found for this signature in database
GPG Key ID: 39563C1504FDD0C9

@ -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

@ -3495,7 +3495,7 @@ var ts;
}
}
function tryGetNodePerformanceHooks() {
if (typeof process !== "undefined" && process.nextTick && !process.browser && typeof module === "object" && typeof require === "function") {
if (typeof process !== "undefined" && process.nextTick && !process.browser && typeof module === "object" && /* MONACOCHANGE */false/* END MONACOCHANGE */) {
try {
var performance_1;
var _a /* MONACOCHANGE */= {}/* END MONACOCHANGE */, nodePerformance_1 = _a.performance, PerformanceObserver_1 = _a.PerformanceObserver;

@ -3495,7 +3495,7 @@ var ts;
}
}
function tryGetNodePerformanceHooks() {
if (typeof process !== "undefined" && process.nextTick && !process.browser && typeof module === "object" && typeof require === "function") {
if (typeof process !== "undefined" && process.nextTick && !process.browser && typeof module === "object" && /* MONACOCHANGE */false/* END MONACOCHANGE */) {
try {
var performance_1;
var _a /* MONACOCHANGE */= {}/* END MONACOCHANGE */, nodePerformance_1 = _a.performance, PerformanceObserver_1 = _a.PerformanceObserver;

Loading…
Cancel
Save