Skip to content

Commit b01a4c6

Browse files
committed
build: switch docs site to application builder
Switches the docs site to use the `application` builder which should be faster than the existing one.
1 parent e5ea9fe commit b01a4c6

File tree

15 files changed

+38
-149
lines changed

15 files changed

+38
-149
lines changed

docs/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,15 @@ Run `pnpm bazel build //docs:build.production` to build the project.
4343
## Running unit tests
4444

4545
1. Run `pnpm bazel test //docs/...` to execute the unit tests via [Karma](https://karma-runner.github.io).
46+
47+
## Scenes Development server
48+
49+
1. Run `pnpm bazel run //docs/scenes:build.serve` for a dev server. Navigate to `http://localhost:4200/`.
50+
51+
# Build
52+
53+
Run `pnpm bazel build //docs/scenes:build.production` to build the project.
54+
55+
## Running unit tests
56+
57+
1. Run `pnpm bazel test //docs/scenes/...` to execute the unit tests via [Karma](https://karma-runner.github.io).

docs/angular.json

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,19 @@
1414
},
1515
"architect": {
1616
"build": {
17-
"builder": "@angular-devkit/build-angular:browser",
17+
"builder": "@angular-devkit/build-angular:application",
1818
"options": {
1919
"sourceMap": true,
20+
"preserveSymlinks": true,
2021
"allowedCommonJsDependencies": ["moment", "path-normalize"],
2122
"outputPath": "dist/material-angular-io",
2223
"index": "src/index.html",
23-
"polyfills": "src/polyfills.ts",
24-
"main": "src/main.ts",
24+
"browser": "src/main.ts",
2525
"tsConfig": "tsconfig.app.json",
26+
"polyfills": [
27+
"zone.js",
28+
"@angular/localize/init"
29+
],
2630
"assets": [
2731
{
2832
"glob": "**/*",
@@ -74,9 +78,7 @@
7478
"includePaths": ["node_modules", "src", "src/styles"]
7579
},
7680
"scripts": [],
77-
"vendorChunk": true,
7881
"extractLicenses": false,
79-
"buildOptimizer": false,
8082
"optimization": false,
8183
"namedChunks": true
8284
},
@@ -88,14 +90,11 @@
8890
"maximumWarning": "6kb"
8991
}
9092
],
91-
"commonChunk": false,
9293
"optimization": true,
9394
"outputHashing": "all",
9495
"sourceMap": false,
9596
"namedChunks": false,
9697
"extractLicenses": true,
97-
"vendorChunk": false,
98-
"buildOptimizer": true,
9998
"fileReplacements": [
10099
{
101100
"replace": "src/environments/environment.ts",
@@ -130,7 +129,6 @@
130129
"builder": "@angular-devkit/build-angular:karma",
131130
"options": {
132131
"main": "src/test.ts",
133-
"polyfills": "src/polyfills.ts",
134132
"karmaConfig": "karma.conf.js",
135133
"tsConfig": "tsconfig.spec.json",
136134
"scripts": [],
@@ -205,19 +203,18 @@
205203
"prefix": "app",
206204
"architect": {
207205
"build": {
208-
"builder": "@angular-devkit/build-angular:browser",
206+
"builder": "@angular-devkit/build-angular:application",
209207
"options": {
210208
"outputPath": "dist/scenes",
211209
"index": "scenes/src/index.html",
212-
"main": "scenes/src/main.ts",
213-
"polyfills": "scenes/src/polyfills.ts",
210+
"browser": "scenes/src/main.ts",
211+
"polyfills": ["zone.js"],
214212
"tsConfig": "scenes/tsconfig.app.json",
215213
"assets": ["scenes/src/favicon.ico", "scenes/src/assets"],
216214
"styles": ["scenes/src/styles.scss"],
217215
"scripts": [],
218-
"vendorChunk": true,
219216
"extractLicenses": false,
220-
"buildOptimizer": false,
217+
"preserveSymlinks": true,
221218
"sourceMap": true,
222219
"optimization": false,
223220
"namedChunks": true
@@ -235,8 +232,6 @@
235232
"sourceMap": false,
236233
"namedChunks": false,
237234
"extractLicenses": true,
238-
"vendorChunk": false,
239-
"buildOptimizer": true,
240235
"budgets": [
241236
{
242237
"type": "initial",
@@ -273,7 +268,6 @@
273268
"builder": "@angular-devkit/build-angular:karma",
274269
"options": {
275270
"main": "scenes/src/test.ts",
276-
"polyfills": "scenes/src/polyfills.ts",
277271
"tsConfig": "scenes/tsconfig.spec.json",
278272
"karmaConfig": "scenes/karma.conf.js",
279273
"assets": ["scenes/src/favicon.ico", "scenes/src/assets"],

docs/scenes/src/polyfills.ts

Lines changed: 0 additions & 57 deletions
This file was deleted.

docs/scenes/src/test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
1010

11+
import 'zone.js';
1112
import 'zone.js/testing';
1213
import {getTestBed} from '@angular/core/testing';
1314
import {BrowserTestingModule, platformBrowserTesting} from '@angular/platform-browser/testing';

docs/scenes/tsconfig.app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"outDir": "../../out-tsc/app",
55
"types": []
66
},
7-
"files": ["src/main.ts", "src/polyfills.ts"],
7+
"files": ["src/main.ts"],
88
"include": ["src/**/*.d.ts"]
99
}

docs/scenes/tsconfig.spec.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"outDir": "../../out-tsc/spec",
55
"types": ["jasmine", "node"]
66
},
7-
"files": ["src/test.ts", "src/polyfills.ts"],
7+
"files": ["src/test.ts"],
88
"include": ["src/**/*.spec.ts", "src/**/*.d.ts"]
99
}

docs/src/app/shared/normalize-path.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.dev/license
77
*/
88

9-
import * as normalize from 'path-normalize';
9+
import normalize from 'path-normalize';
1010

1111
/**
1212
* Normalizes the given path by:

docs/src/assets/stack-blitz/angular.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,15 @@
2121
"prefix": "app",
2222
"architect": {
2323
"build": {
24-
"builder": "@angular-devkit/build-angular:browser",
24+
"builder": "@angular-devkit/build-angular:application",
2525
"options": {
2626
"outputPath": "dist/example-app",
2727
"index": "src/index.html",
28-
"main": "src/main.ts",
29-
"polyfills": ["zone.js"],
28+
"browser": "src/main.ts",
29+
"polyfills": [
30+
"zone.js",
31+
"@angular/localize/init"
32+
],
3033
"tsConfig": "tsconfig.app.json",
3134
"inlineStyleLanguage": "scss",
3235
"assets": ["src/assets"],
@@ -59,9 +62,7 @@
5962
"outputHashing": "all"
6063
},
6164
"development": {
62-
"buildOptimizer": false,
6365
"optimization": false,
64-
"vendorChunk": true,
6566
"extractLicenses": false,
6667
"sourceMap": true,
6768
"namedChunks": true

docs/src/assets/stack-blitz/src/main.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
* found in the LICENSE file at https://angular.dev/license
77
*/
88

9-
import '@angular/localize/init';
109
import {bootstrapApplication} from '@angular/platform-browser';
1110
import {provideHttpClient} from '@angular/common/http';
1211
import {provideAnimations} from '@angular/platform-browser/animations';

docs/src/polyfills.ts

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)