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
This commit is contained in:
George Kalpakas 2019-10-16 23:07:01 +03:00 committed by Matias Niemelä
parent 11bf7679a1
commit 31b5db6fa8
1 changed files with 1 additions and 3 deletions

View File

@ -80,9 +80,7 @@ class ExampleBoilerPlate {
} }
if (ivy) { if (ivy) {
// We only need the "es2015" bundles as the CLI webpack build does not need shelljs.exec(`yarn --cwd ${SHARED_PATH} ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points`);
// any other formats for building and serving.
shelljs.exec(`yarn --cwd ${SHARED_PATH} ngcc --properties es2015`);
} }
exampleFolders.forEach(exampleFolder => { exampleFolders.forEach(exampleFolder => {