From 16fe90d6ac39ca6a67e7ed70922b160f3c6c953a 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, when compiling the docs examples with `ngcc` (to run them in Ivy mode), we would only consider the `es2015` property. However, some packages (such as `angular-in-memory-web-api`) may not have that property in their `package.json`. They might still be compilable by `ngcc`, if they define other format properties (such as `module` or `main`), but `ngcc` would still fail if it could not find any of the _specified_ properties (here only `es2015`): ``` Error: Unable to process any formats for the following entry-points (tried es2015): - /.../node_modules/angular-in-memory-web-api ``` This commit fixes potential issues by considering all properties that would be considered if `ngcc` was run implicitly by `@angular/cli` and aligns the command with the one that will be generated for new 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 => {