From 31b5db6fa876d4bc72f8874fadd2cd719c4c729e Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Wed, 16 Oct 2019 23:07:01 +0300 Subject: [PATCH] fix(docs-infra): consider all formats when compiling docs examples with `ngcc` (#33206) Previously, we would only consider the `es2015` property, but some packages (such as `angular-in-memory-web-api`) may not have that. They might still be compilable by `ngcc`, is they have other format properties (e.g. `module` or `main`). This commit fixes potential issues by considering all properties that would be considered via the cli integration and aligns the command to turn on ivy for docs examples with the one used in new cli apps: https://github.com/angular/angular/blob/3e14c2d02/packages/core/schematics/migrations/postinstall-ngcc/index.ts#L22 PR Close #33206 --- aio/tools/examples/example-boilerplate.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/aio/tools/examples/example-boilerplate.js b/aio/tools/examples/example-boilerplate.js index 1248055aca..f1290ad2fb 100644 --- a/aio/tools/examples/example-boilerplate.js +++ b/aio/tools/examples/example-boilerplate.js @@ -80,9 +80,7 @@ class ExampleBoilerPlate { } if (ivy) { - // We only need the "es2015" bundles as the CLI webpack build does not need - // any other formats for building and serving. - shelljs.exec(`yarn --cwd ${SHARED_PATH} ngcc --properties es2015`); + shelljs.exec(`yarn --cwd ${SHARED_PATH} ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points`); } exampleFolders.forEach(exampleFolder => {