This repository was archived by the owner on Nov 5, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,11 @@ export const typescriptVersion = "${typeScriptDependencyVersion}";\n`
59
59
'$1// MONACOCHANGE\n$1var result = undefined;\n$1// END MONACOCHANGE'
60
60
) ;
61
61
62
+ tsServices = tsServices . replace (
63
+ / ^ ( + ) f s = r e q u i r e \( " f s " \) ; $ / m,
64
+ '$1// MONACOCHANGE\n$1fs = undefined;\n$1// END MONACOCHANGE'
65
+ ) ;
66
+
62
67
// Flag any new require calls (outside comments) so they can be corrected preemptively.
63
68
// To avoid missing cases (or using an even more complex regex), temporarily remove comments
64
69
// about require() and then check for lines actually calling require().
@@ -74,13 +79,13 @@ export const typescriptVersion = "${typeScriptDependencyVersion}";\n`
74
79
75
80
// Allow error messages to include references to require() in their strings
76
81
const runtimeRequires =
77
- linesWithRequire && linesWithRequire . filter ( ( l ) => ! l . includes ( ': diag(' ) ) ;
82
+ linesWithRequire && linesWithRequire . filter ( ( l ) => ! l . includes ( ': diag(' ) && ! l . includes ( "ts.DiagnosticCategory" ) ) ;
78
83
79
84
if ( runtimeRequires && runtimeRequires . length && linesWithRequire ) {
80
85
console . error (
81
86
'Found new require() calls on the following lines. These should be removed to avoid breaking webpack builds.\n'
82
87
) ;
83
- console . error ( linesWithRequire . join ( '\n' ) ) ;
88
+ console . error ( runtimeRequires . map ( r => ` ${ r } ( ${ tsServicesNoCommentedRequire . indexOf ( r ) } )` ) . join ( '\n' ) ) ;
84
89
process . exit ( 1 ) ;
85
90
}
86
91
You can’t perform that action at this time.
0 commit comments