|
6 | 6 | * found in the LICENSE file at https://angular.io/license |
7 | 7 | */ |
8 | 8 |
|
9 | | -import { appendToFile, prependToFile, readFile, replaceInFile, writeFile } from '../../utils/fs'; |
| 9 | +import { readFile, replaceInFile, writeFile } from '../../utils/fs'; |
10 | 10 | import { ng } from '../../utils/process'; |
11 | 11 | import { updateJsonFile } from '../../utils/project'; |
12 | 12 |
|
13 | 13 | export default async function () { |
14 | 14 | const projectName = 'test-project'; |
15 | 15 | const appRoutingModulePath = 'src/app/app-routing.module.ts'; |
16 | 16 |
|
17 | | - // Add app routing. |
18 | | - // This is done automatically on a new app with --routing. |
19 | | - await writeFile( |
20 | | - appRoutingModulePath, |
21 | | - ` |
22 | | - import { NgModule } from '@angular/core'; |
23 | | - import { Routes, RouterModule } from '@angular/router'; |
24 | | -
|
25 | | - const routes: Routes = []; |
26 | | -
|
27 | | - @NgModule({ |
28 | | - imports: [RouterModule.forRoot(routes)], |
29 | | - exports: [RouterModule] |
30 | | - }) |
31 | | - export class AppRoutingModule { } |
32 | | - `, |
33 | | - ); |
34 | | - await prependToFile( |
35 | | - 'src/app/app.module.ts', |
36 | | - `import { AppRoutingModule } from './app-routing.module';`, |
37 | | - ); |
38 | | - await replaceInFile('src/app/app.module.ts', `imports: [`, `imports: [ AppRoutingModule,`); |
39 | | - await appendToFile('src/app/app.component.html', '<router-outlet></router-outlet>'); |
40 | | - |
41 | 17 | const originalAppRoutingModule = await readFile(appRoutingModulePath); |
42 | 18 | // helper to replace loadChildren |
43 | 19 | const replaceLoadChildren = async (route: string) => { |
|
0 commit comments