Skip to content

Commit 4aec78a

Browse files
committed
fix(@schematics/angular): remove explicit index option from new applications
With the index option now defaulting to `<project_source_root>/index.html` for the `application` build system, the explicit value present in new applications is no longer required. This removal further reduces the size of the `angular.json` file for new projects.
1 parent fd6275e commit 4aec78a

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

packages/schematics/angular/application/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ function addAppToWorkspaceFile(
256256
builder: Builders.BuildApplication,
257257
defaultConfiguration: 'production',
258258
options: {
259-
index: `${sourceRoot}/index.html`,
260259
browser: `${sourceRoot}/main.ts`,
261260
polyfills: options.experimentalZoneless ? [] : ['zone.js'],
262261
tsConfig: `${projectRoot}tsconfig.app.json`,

packages/schematics/angular/application/index_spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ describe('Application Schematic', () => {
314314
const prj = config.projects.foo;
315315
expect(prj.root).toEqual('');
316316
const buildOpt = prj.architect.build.options;
317-
expect(buildOpt.index).toEqual('src/index.html');
317+
expect(buildOpt.index).toBeUndefined();
318318
expect(buildOpt.browser).toEqual('src/main.ts');
319319
expect(buildOpt.assets).toEqual([{ 'glob': '**/*', 'input': 'public' }]);
320320
expect(buildOpt.polyfills).toEqual(['zone.js']);
@@ -405,7 +405,6 @@ describe('Application Schematic', () => {
405405
const project = config.projects.foo;
406406
expect(project.root).toEqual('foo');
407407
const buildOpt = project.architect.build.options;
408-
expect(buildOpt.index).toEqual('foo/src/index.html');
409408
expect(buildOpt.browser).toEqual('foo/src/main.ts');
410409
expect(buildOpt.polyfills).toEqual(['zone.js']);
411410
expect(buildOpt.tsConfig).toEqual('foo/tsconfig.app.json');

0 commit comments

Comments
 (0)