@@ -45,6 +45,11 @@ export function checkCommonJSModules(
45
45
// using `provideHttpClient(withFetch())`.
46
46
allowedRequests . add ( 'xhr2' ) ;
47
47
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
+
48
53
// Find all entry points that contain code (JS/TS)
49
54
const files : string [ ] = [ ] ;
50
55
for ( const { entryPoint } of Object . values ( metafile . outputs ) ) {
@@ -72,8 +77,14 @@ export function checkCommonJSModules(
72
77
if ( ! imported . original || seenFiles . has ( imported . path ) ) {
73
78
continue ;
74
79
}
80
+
75
81
seenFiles . add ( imported . path ) ;
76
82
83
+ // If the dependency is allowed ignore all other checks
84
+ if ( allowedRequests . has ( imported . original ) ) {
85
+ continue ;
86
+ }
87
+
77
88
// Only check actual code files
78
89
if ( ! isPathCode ( imported . path ) ) {
79
90
continue ;
@@ -137,11 +148,7 @@ function isPathCode(name: string): boolean {
137
148
* @returns True, if specifier is potentially relative; false, otherwise.
138
149
*/
139
150
function isPotentialRelative ( specifier : string ) : boolean {
140
- if ( specifier [ 0 ] === '.' ) {
141
- return true ;
142
- }
143
-
144
- return false ;
151
+ return specifier [ 0 ] === '.' ;
145
152
}
146
153
147
154
/**
0 commit comments