diff --git a/packages/schematics/src/collection/application/application.spec.ts b/packages/schematics/src/collection/application/application.spec.ts index ce46fb2778..ba2f317247 100644 --- a/packages/schematics/src/collection/application/application.spec.ts +++ b/packages/schematics/src/collection/application/application.spec.ts @@ -236,17 +236,6 @@ describe('app', () => { }); }); - it('should import NgModule', async () => { - const tree = await runSchematic( - 'app', - { name: 'myApp', directory: 'myDir' }, - appTree - ); - expect( - getFileContent(tree, 'apps/my-dir/my-app/src/app/app.module.ts') - ).toContain('NxModule.forRoot()'); - }); - describe('routing', () => { it('should include RouterTestingModule', async () => { const tree = await runSchematic( diff --git a/packages/schematics/src/collection/application/index.ts b/packages/schematics/src/collection/application/index.ts index 6063bb1f0e..c48369c0ec 100644 --- a/packages/schematics/src/collection/application/index.ts +++ b/packages/schematics/src/collection/application/index.ts @@ -44,24 +44,6 @@ interface NormalizedSchema extends Schema { parsedTags: string[]; } -function addNxModule(options: NormalizedSchema): Rule { - return (host: Tree) => { - const modulePath = `${options.appProjectRoot}/src/app/app.module.ts`; - const moduleSource = host.read(modulePath)!.toString('utf-8'); - const sourceFile = ts.createSourceFile( - modulePath, - moduleSource, - ts.ScriptTarget.Latest, - true - ); - insert(host, modulePath, [ - insertImport(sourceFile, modulePath, 'NxModule', '@nrwl/nx'), - ...addImportToModule(sourceFile, modulePath, 'NxModule.forRoot()') - ]); - return host; - }; -} - function addRouterRootConfiguration(options: NormalizedSchema): Rule { return (host: Tree) => { const modulePath = `${options.appProjectRoot}/src/app/app.module.ts`; @@ -379,7 +361,6 @@ export default function(schema: Schema): Rule { updateProject(options), updateComponentTemplate(options), - addNxModule(options), options.routing ? addRouterRootConfiguration(options) : noop(), options.unitTestRunner === 'jest' ? schematic('jest-project', {