How do I enable Ivy on a Angular 8 or 9 project?
Ivy is the upcoming render engine for Angular which introduces a lot of nice features without changing the current code base of Angular projects.
Ivy enabled by defaultIn version 9, we instead have to opt-out of Ivy if we want to fall back to View Engine. This is possible in both angular versions 9 and 10 to ensure a smoother transition from View Engine to Ivy. Libraries can be AOT-compiled directly to Ivy instructions and metadata, but this is not recommended.
You can open your application in chrome browser and check if any of elements inside your Angular application has __ngContext__ property. This approach also works with Angular 9.0.
To opt out of Ivy, change the angularCompilerOptions in your project's TypeScript configuration, most commonly located at tsconfig. app. json at the root of the workspace. The value of the enableIvy flag is set to true by default, as of version 9.
The 9.0. 0 release of Angular is here! This is a major release that spans the entire platform, including the framework, Angular Material, and the CLI. This release switches applications to the Ivy compiler and runtime by default, and introduces improved ways of testing components.
source and more information go though this
Reference : https://dzone.com/articles/how-to-upgrade-angular-packagesenable-ivy-compiler
you can auto upgrade
npm i -g @angular/cli@latestng update
or in your tsconfig.json
file update this
{ "compilerOptions": { "module": "esnext", // ... }, "angularCompilerOptions": { "enableIvy": true, "allowEmptyCodegenFiles": true } }
then your angular.json
file
{ "projects": { "your-project": { "architect": { "build": { "options": { ... "aot": true, } } } } } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With