Since Angular 10, we have had the following set in an angular library:
"angularCompilerOptions": {
"enableIvy": false
}
I am now trying to use the Ivy compiler as we upgrade to Angular 12. From everything I've read, since Ivy is the default, either removing enableIvy
or setting it to true
should cause the build to use Ivy. However, with either of those changes, I still see:
Compiling with Angular in legacy View Engine compilation mode.
For comparison, I started a new library, and there I see:
Compiling with Angular sources in Ivy full compilation mode.
I can't figure out what else is different that is causing Angular to still use View Engine. What else should I be looking for?
Had the problem with Angular 12 and packagr and solved it in two steps:
"angularCompilerOptions": {
"enableIvy": true,
"compilationMode": "partial"
}
The compilationMode
is relevant, when you want to publish your lib to any npm registry.
"packagr": "ng-packagr -p ./src/lib/package.json -c ./src/tsconfig.json"
The -c
(or --config
) part is missing in most examples.