docs: add postinstall script removal to Ivy guide (#32999)
PR Close #32999
This commit is contained in:
parent
30d25f67af
commit
ec6a9f2a02
@ -6,21 +6,21 @@ The previous compilation and rendering pipeline, View Engine, is deprecated in v
|
|||||||
You can choose to opt out of Ivy and continue using View Engine while making the transition.
|
You can choose to opt out of Ivy and continue using View Engine while making the transition.
|
||||||
|
|
||||||
To opt out of Ivy and continue using View Engine for an existing project, set the `enableIvy` option in the `angularCompilerOptions` in your project's `tsconfig.json` to `false`.
|
To opt out of Ivy and continue using View Engine for an existing project, set the `enableIvy` option in the `angularCompilerOptions` in your project's `tsconfig.json` to `false`.
|
||||||
```json
|
<code-example language="json" header="tsconfig.json">
|
||||||
{
|
{
|
||||||
"compilerOptions": { ... },
|
"compilerOptions": { ... },
|
||||||
"angularCompilerOptions": {
|
"angularCompilerOptions": {
|
||||||
"enableIvy": false
|
"enableIvy": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
</code-example>
|
||||||
|
|
||||||
AOT compilation with Ivy is faster than with View Engine, and can be used for development.
|
AOT compilation with Ivy is faster than with View Engine, and can be used for development.
|
||||||
If you opt out of Ivy, AOT compilation will be slower, and should not be used for development in large projects.
|
If you opt out of Ivy, AOT compilation will be slower, and should not be used for development in large projects.
|
||||||
When Ivy is disabled for a large project, make sure that the `aot` build option in that project configuration is
|
When Ivy is disabled for a large project, make sure that the `aot` build option in that project configuration is
|
||||||
set to `false` and it's only set to `true` in the `production` configuration.
|
set to `false` and it's only set to `true` in the `production` configuration.
|
||||||
|
|
||||||
```json
|
<code-example language="json" header="angular.json">
|
||||||
{
|
{
|
||||||
"projects": {
|
"projects": {
|
||||||
"my-existing-project": {
|
"my-existing-project": {
|
||||||
@ -41,4 +41,15 @@ set to `false` and it's only set to `true` in the `production` configuration.
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
</code-example>
|
||||||
|
|
||||||
|
Ivy projects usually contain a `postinstall` script in the `scripts` section of `package.json` that converts packages in `node_modules` to use Ivy as well.
|
||||||
|
When you opt out of Ivy, remove this script. Remove the following line in package.json.
|
||||||
|
|
||||||
|
<code-example language="json" header="package.json">
|
||||||
|
{
|
||||||
|
"scripts": {
|
||||||
|
"postinstall": "ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</code-example>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user