Skip to content

Commit 8b2dd26

Browse files
committed
fix(@schematics/angular): remove setting files tsconfig field with SSR/Server generation
The `files` field within the `tsconfig.app.json` file is no longer used with the "solution" style tsconfig generated with applications. The SSR and server schematics no longer need to modify this field since all TS files within `src` are included by default.
1 parent 16244c0 commit 8b2dd26

File tree

3 files changed

+1
-6
lines changed

3 files changed

+1
-6
lines changed

packages/schematics/angular/server/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,6 @@ function updateConfigFileApplicationBuilder(options: ServerOptions): Rule {
119119
function updateTsConfigFile(tsConfigPath: string): Rule {
120120
return (host: Tree) => {
121121
const json = new JSONFile(host, tsConfigPath);
122-
const filesPath = ['files'];
123-
const files = new Set((json.get(filesPath) as string[] | undefined) ?? []);
124-
files.add('src/' + serverMainEntryName);
125-
json.modify(filesPath, [...files]);
126122

127123
const typePath = ['compilerOptions', 'types'];
128124
const types = new Set((json.get(typePath) as string[] | undefined) ?? []);

packages/schematics/angular/server/index_spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ describe('Server Schematic', () => {
167167
const filePath = '/projects/bar/tsconfig.app.json';
168168
const contents = parseJson(tree.readContent(filePath).toString());
169169
expect(contents.compilerOptions.types).toEqual(['node']);
170-
expect(contents.files).toEqual(['src/main.ts', 'src/main.server.ts']);
171170
});
172171

173172
it(`should add 'provideClientHydration' to the providers list`, async () => {

packages/schematics/angular/ssr/index_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ describe('SSR Schematic', () => {
7676
files: string[];
7777
};
7878

79-
expect(files).toEqual(['src/main.ts', 'src/main.server.ts', 'src/server.ts']);
79+
expect(files).toContain('src/server.ts');
8080
});
8181
});
8282

0 commit comments

Comments
 (0)