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`
5959 '$1// MONACOCHANGE\n$1var result = undefined;\n$1// END MONACOCHANGE'
6060 ) ;
6161
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+
6267 // Flag any new require calls (outside comments) so they can be corrected preemptively.
6368 // To avoid missing cases (or using an even more complex regex), temporarily remove comments
6469 // about require() and then check for lines actually calling require().
@@ -74,13 +79,13 @@ export const typescriptVersion = "${typeScriptDependencyVersion}";\n`
7479
7580 // Allow error messages to include references to require() in their strings
7681 const runtimeRequires =
77- linesWithRequire && linesWithRequire . filter ( ( l ) => ! l . includes ( ': diag(' ) ) ;
82+ linesWithRequire && linesWithRequire . filter ( ( l ) => ! l . includes ( ': diag(' ) && ! l . includes ( "ts.DiagnosticCategory" ) ) ;
7883
7984 if ( runtimeRequires && runtimeRequires . length && linesWithRequire ) {
8085 console . error (
8186 'Found new require() calls on the following lines. These should be removed to avoid breaking webpack builds.\n'
8287 ) ;
83- console . error ( linesWithRequire . join ( '\n' ) ) ;
88+ console . error ( runtimeRequires . map ( r => ` ${ r } ( ${ tsServicesNoCommentedRequire . indexOf ( r ) } )` ) . join ( '\n' ) ) ;
8489 process . exit ( 1 ) ;
8590 }
8691
You can’t perform that action at this time.
0 commit comments