From 2864108510775752756d6c65f3ecd678e4213f47 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Fri, 19 Apr 2019 16:50:14 +0100 Subject: [PATCH] docs: remove lazy route step from Ivy opt-in (#29955) PR Close #29955 --- aio/content/guide/ivy.md | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/aio/content/guide/ivy.md b/aio/content/guide/ivy.md index 1521064706..0530fb0e12 100644 --- a/aio/content/guide/ivy.md +++ b/aio/content/guide/ivy.md @@ -28,28 +28,8 @@ You can update an existing project to use Ivy by making the following configurat } } ``` -- Set `"module": "esnext"` inside `compilerOptions` in your `tsconfig.json` to support the [ES `import()` statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import). -```json -{ - "compilerOptions": { - ... - "module": "esnext", - } -} -``` -- Update your lazy routes to use the `import()` statement. You can use [angular-lazy-routes-fix](https://github.com/phenomnomnominal/angular-lazy-routes-fix) to automatically transform them. -```typescript -const routes: Routes = [{ - path: 'lazy', - // The string syntax for loadChildren is not supported in Ivy: - // loadChildren: './lazy/lazy.module#LazyModule' - // Instead use the import statement: - loadChildren: () => import('./lazy/lazy.module').then(m => m.LazyModule) -}]; -``` ## Switching back to the current compiler To stop using the Ivy compiler you need to undo the steps taken when [updating to use Ivy](#updating). -- Set `enableIvy` to false in `tsconfig.app.json`, or remove it completely. -- Add `"experimentalImportFactories": true` to your default build options in `angular.json` to support the import statement in `loadChildren` outside Ivy. +- Set `enableIvy` to `false` in `tsconfig.app.json`, or remove it completely. \ No newline at end of file