From 5195ff487c0c2705676a87e6b8ea44a60685f303 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Fri, 7 Aug 2020 14:56:13 +0200 Subject: [PATCH] fix(@ngtools/webpack): issue warning when using `strictMetadataEmit` `strictMetadataEmit` option which is not intended to be used for applications. See: https://angular.io/guide/angular-compiler-options#strictmetadataemit Closes #18424 --- packages/ngtools/webpack/src/angular_compiler_plugin.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/ngtools/webpack/src/angular_compiler_plugin.ts b/packages/ngtools/webpack/src/angular_compiler_plugin.ts index 6bc056745611..316bec3df26c 100644 --- a/packages/ngtools/webpack/src/angular_compiler_plugin.ts +++ b/packages/ngtools/webpack/src/angular_compiler_plugin.ts @@ -275,6 +275,14 @@ export class AngularCompilerPlugin { ); } + if (this._compilerOptions.strictMetadataEmit) { + this._warnings.push( + new Error( + `Using Angular compiler option 'strictMetadataEmit' for applications might cause undefined behavior.`, + ), + ); + } + if (this._discoverLazyRoutes === false && this.options.additionalLazyModules && Object.keys(this.options.additionalLazyModules).length > 0) { this._warnings.push(