Skip to content

Commit ec160fe

Browse files
clydindgp1130
authored andcommitted
fix(@angular-devkit/build-angular): warn if using partial mode with application builder
The Angular compiler's partial compilation mode is only intended for use when building libraries. If attempting to use the mode while building an application, the application would fail. A warning is now issued if partial mode is configured for the application and the mode is switched to full compilation mode to prevent the build from failing due to the option value. (cherry picked from commit 175ad37)
1 parent 1a6aa43 commit ec160fe

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,15 @@ export function createCompilerPlugin(
257257
});
258258
}
259259

260+
if (compilerOptions.compilationMode === 'partial') {
261+
setupWarnings?.push({
262+
text: 'Angular partial compilation mode is not supported when building applications.',
263+
location: null,
264+
notes: [{ text: 'Full compilation mode will be used instead.' }],
265+
});
266+
compilerOptions.compilationMode = 'full';
267+
}
268+
260269
// Enable incremental compilation by default if caching is enabled
261270
if (pluginOptions.sourceFileCache?.persistentCachePath) {
262271
compilerOptions.incremental ??= true;

0 commit comments

Comments
 (0)