diff --git a/packages/schematics/angular/migrations/migration-collection.json b/packages/schematics/angular/migrations/migration-collection.json index d6a8c8cea3..df85b3b8a2 100644 --- a/packages/schematics/angular/migrations/migration-collection.json +++ b/packages/schematics/angular/migrations/migration-collection.json @@ -95,15 +95,15 @@ "factory": "./update-10/solution-style-tsconfig", "description": "Add \"Solution Style\" TypeScript configuration file support. This improves developer experience using editors powered by TypeScript’s language server. Read more about this here: https://v10.angular.io/guide/migration-solution-style-tsconfig" }, - "update-module-and-target-compiler-options": { - "version": "10.0.0-rc.1", - "factory": "./update-10/update-module-and-target-compiler-options", - "description": "Update 'module' and 'target' TypeScript compiler options. Read more about this here: https://v10.angular.io/guide/migration-update-module-and-target-compiler-options" - }, "update-workspace-dependencies": { "version": "10.0.0-rc.2", "factory": "./update-10/update-dependencies", "description": "Update workspace dependencies to match a new v10 project." + }, + "update-module-and-target-compiler-options": { + "version": "10.0.1", + "factory": "./update-10/update-module-and-target-compiler-options", + "description": "Update 'module' and 'target' TypeScript compiler options. Read more about this here: https://v10.angular.io/guide/migration-update-module-and-target-compiler-options" } } } diff --git a/packages/schematics/angular/migrations/update-10/update-module-and-target-compiler-options.ts b/packages/schematics/angular/migrations/update-10/update-module-and-target-compiler-options.ts index 26131f367f..3c710b3825 100644 --- a/packages/schematics/angular/migrations/update-10/update-module-and-target-compiler-options.ts +++ b/packages/schematics/angular/migrations/update-10/update-module-and-target-compiler-options.ts @@ -23,7 +23,7 @@ interface ModuleAndTargetReplamenent { export default function (): Rule { return async host => { // Workspace level tsconfig - updateModuleAndTarget(host, 'tsconfig.json', { + updateModuleAndTarget(host, 'tsconfig.base.json', { oldModule: 'esnext', newModule: 'es2020', }); diff --git a/packages/schematics/angular/migrations/update-10/update-module-and-target-compiler-options_spec.ts b/packages/schematics/angular/migrations/update-10/update-module-and-target-compiler-options_spec.ts index 0e47360132..5de9c28ccd 100644 --- a/packages/schematics/angular/migrations/update-10/update-module-and-target-compiler-options_spec.ts +++ b/packages/schematics/angular/migrations/update-10/update-module-and-target-compiler-options_spec.ts @@ -91,7 +91,7 @@ describe('Migration to update target and module compiler options', () => { const compilerOptions = { target: 'es2015', module: 'esnext' }; // Workspace - createJsonFile(tree, 'tsconfig.json', { compilerOptions }); + createJsonFile(tree, 'tsconfig.base.json', { compilerOptions }); // Application createJsonFile(tree, 'src/tsconfig.app.json', { compilerOptions }); @@ -106,19 +106,19 @@ describe('Migration to update target and module compiler options', () => { createJsonFile(tree, 'src/tsconfig.server.json', { compilerOptions: { module: 'commonjs' } }); }); - it(`should update module and target in workspace 'tsconfig.json'`, async () => { + it(`should update module and target in workspace 'tsconfig.base.json'`, async () => { const newTree = await schematicRunner.runSchematicAsync(schematicName, {}, tree).toPromise(); - const { module } = readJsonFile(newTree, 'tsconfig.json').compilerOptions; + const { module } = readJsonFile(newTree, 'tsconfig.base.json').compilerOptions; expect(module).toBe('es2020'); }); - it(`should update module and target in 'tsconfig.json' which is referenced in option`, async () => { + it(`should update module and target in 'tsconfig.base.json' which is referenced in option`, async () => { const newTree = await schematicRunner.runSchematicAsync(schematicName, {}, tree).toPromise(); const { module } = readJsonFile(newTree, 'src/tsconfig.spec.json').compilerOptions; expect(module).toBe('es2020'); }); - it(`should update module and target in 'tsconfig.json' which is referenced in a configuration`, async () => { + it(`should update module and target in 'tsconfig.base.json' which is referenced in a configuration`, async () => { const newTree = await schematicRunner.runSchematicAsync(schematicName, {}, tree).toPromise(); const { module } = readJsonFile(newTree, 'src/tsconfig.app.prod.json').compilerOptions; expect(module).toBe('es2020');