Skip to content

Commit 9d4d11c

Browse files
clydinalan-agius4
authored andcommitted
fix(@angular-devkit/build-angular): allow SSR compilation to work with TS allowJs option
When using the `application` builder with SSR enabled and the `allowJs` TypeScript option, the build would previously generate warnings about undefined imports. This was caused by the recently introduced initialization error handling that was not accounting for the early exit of the SSR compiler plugin's `onStart` hook. This early exit prevent the error status checking from completing which resulted in the SSR plugin load hook assuming an error had occurred. This in turn caused JavaScript files that were not imported into TypeScript files to be returned as empty content to avoid the not found error message. To remedy this situation, the error status is now also set during the SSR early exit. (cherry picked from commit 3470bff)
1 parent ec5e302 commit 9d4d11c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/angular_devkit/build_angular/src/tools/esbuild/angular/compiler-plugin.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ export function createCompilerPlugin(
264264

265265
if (compilation instanceof NoopCompilation) {
266266
await sharedTSCompilationState.waitUntilReady;
267+
hasCompilationErrors = false;
267268

268269
return result;
269270
}

0 commit comments

Comments
 (0)