@@ -45,6 +45,11 @@ export function checkCommonJSModules(
4545 // using `provideHttpClient(withFetch())`.
4646 allowedRequests . add ( 'xhr2' ) ;
4747
48+ // Packages used by @angular /ssr.
49+ // While critters is ESM it has a number of direct and transtive CJS deps.
50+ allowedRequests . add ( 'express' ) ;
51+ allowedRequests . add ( 'critters' ) ;
52+
4853 // Find all entry points that contain code (JS/TS)
4954 const files : string [ ] = [ ] ;
5055 for ( const { entryPoint } of Object . values ( metafile . outputs ) ) {
@@ -72,8 +77,14 @@ export function checkCommonJSModules(
7277 if ( ! imported . original || seenFiles . has ( imported . path ) ) {
7378 continue ;
7479 }
80+
7581 seenFiles . add ( imported . path ) ;
7682
83+ // If the dependency is allowed ignore all other checks
84+ if ( allowedRequests . has ( imported . original ) ) {
85+ continue ;
86+ }
87+
7788 // Only check actual code files
7889 if ( ! isPathCode ( imported . path ) ) {
7990 continue ;
@@ -137,11 +148,7 @@ function isPathCode(name: string): boolean {
137148 * @returns True, if specifier is potentially relative; false, otherwise.
138149 */
139150function isPotentialRelative ( specifier : string ) : boolean {
140- if ( specifier [ 0 ] === '.' ) {
141- return true ;
142- }
143-
144- return false ;
151+ return specifier [ 0 ] === '.' ;
145152}
146153
147154/**
0 commit comments