Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 901ab60

Browse filesBrowse 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. (cherry picked from commit b1afa31)
1 parent a6a0b41 commit 901ab60
Copy full SHA for 901ab60

File tree

8 files changed

+7
-3
lines changed
Filter options

8 files changed

+7
-3
lines changed

‎packages/schematics/angular/application/index.ts

Copy file name to clipboardExpand all lines: packages/schematics/angular/application/index.ts
-1Lines 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.zoneless ? undefined : ['zone.js'],
262261
tsConfig: `${projectRoot}tsconfig.app.json`,

‎packages/schematics/angular/application/index_spec.ts

Copy file name to clipboardExpand all lines: packages/schematics/angular/application/index_spec.ts
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ describe('Application Schematic', () => {
330330
const prj = config.projects.foo;
331331
expect(prj.root).toEqual('');
332332
const buildOpt = prj.architect.build.options;
333-
expect(buildOpt.index).toEqual('src/index.html');
333+
expect(buildOpt.index).toBeUndefined();
334334
expect(buildOpt.browser).toEqual('src/main.ts');
335335
expect(buildOpt.assets).toEqual([{ 'glob': '**/*', 'input': 'public' }]);
336336
expect(buildOpt.polyfills).toEqual(['zone.js']);
@@ -421,7 +421,6 @@ describe('Application Schematic', () => {
421421
const project = config.projects.foo;
422422
expect(project.root).toEqual('foo');
423423
const buildOpt = project.architect.build.options;
424-
expect(buildOpt.index).toEqual('foo/src/index.html');
425424
expect(buildOpt.browser).toEqual('foo/src/main.ts');
426425
expect(buildOpt.polyfills).toEqual(['zone.js']);
427426
expect(buildOpt.tsConfig).toEqual('foo/tsconfig.app.json');

‎tests/legacy-cli/e2e/initialize/500-create-project.ts

Copy file name to clipboardExpand all lines: tests/legacy-cli/e2e/initialize/500-create-project.ts
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export default async function () {
3535
main: build.options.browser,
3636
browser: undefined,
3737
outputPath: 'dist/test-project/browser',
38+
index: 'src/index.html',
3839
};
3940

4041
build.configurations.development = {

‎tests/legacy-cli/e2e/tests/build/jit-ngmodule.ts

Copy file name to clipboardExpand all lines: tests/legacy-cli/e2e/tests/build/jit-ngmodule.ts
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export default async function () {
2424
browser: undefined,
2525
buildOptimizer: false,
2626
outputPath: 'dist/test-project-two',
27+
index: 'src/index.html',
2728
};
2829

2930
build.configurations.development = {

‎tests/legacy-cli/e2e/tests/build/prerender/discover-routes-ngmodule.ts

Copy file name to clipboardExpand all lines: tests/legacy-cli/e2e/tests/build/prerender/discover-routes-ngmodule.ts
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export default async function () {
1919
...build.options,
2020
main: build.options.browser,
2121
browser: undefined,
22+
index: 'src/index.html',
2223
};
2324

2425
build.configurations.development = {

‎tests/legacy-cli/e2e/tests/build/rebuild-dot-dirname.ts

Copy file name to clipboardExpand all lines: tests/legacy-cli/e2e/tests/build/rebuild-dot-dirname.ts
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export default async function () {
3434
main: build.options.browser,
3535
browser: undefined,
3636
outputPath: 'dist/subdirectory-test-project',
37+
index: 'src/index.html',
3738
};
3839

3940
build.configurations.development = {

‎tests/legacy-cli/e2e/tests/build/relative-sourcemap.ts

Copy file name to clipboardExpand all lines: tests/legacy-cli/e2e/tests/build/relative-sourcemap.ts
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export default async function () {
1919
main: build.options.browser,
2020
browser: undefined,
2121
outputPath: 'dist/secondary-project',
22+
index: 'src/index.html',
2223
};
2324

2425
build.configurations.development = {

‎tests/legacy-cli/e2e/tests/build/server-rendering/express-engine-ngmodule.ts

Copy file name to clipboardExpand all lines: tests/legacy-cli/e2e/tests/build/server-rendering/express-engine-ngmodule.ts
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export default async function () {
3232
...build.options,
3333
main: build.options.browser,
3434
browser: undefined,
35+
index: 'src/index.html',
3536
};
3637

3738
build.configurations.development = {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.