Skip to content

Commit e95ecb8

Browse files
committed
feat(@angular-devkit/build-angular): deprecate deployUrl
With this change we deprecate deployUrl which in many case causes unexpected and undesired behaviour. Such as #12322, #21432 and #6666. This is because one of the drawbacks of deploy Url is that this url needs to be injected all over the bundles. This option was previously introduced to handle application that only assets are hosted on a CDN. This setup is now mostly considered as legacy as it is recommended that the entire application is hosted on a CDN. That said, this legacy behaviour can still be achieved by setting the `baseHref` to the CDN address, while setting the `APP_BASE_HREF` to the application address. Closes #12322 and closes #6666
1 parent cb7d156 commit e95ecb8

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

goldens/public-api/angular_devkit/build_angular/src/index.md

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export interface BrowserBuilderOptions {
3939
commonChunk?: boolean;
4040
crossOrigin?: CrossOrigin;
4141
deleteOutputPath?: boolean;
42+
// @deprecated
4243
deployUrl?: string;
4344
extractLicenses?: boolean;
4445
fileReplacements?: FileReplacement[];
@@ -253,6 +254,7 @@ export interface ProtractorBuilderOptions {
253254
export interface ServerBuilderOptions {
254255
bundleDependencies?: BundleDependenciesUnion;
255256
deleteOutputPath?: boolean;
257+
// @deprecated
256258
deployUrl?: string;
257259
externalDependencies?: string[];
258260
extractLicenses?: boolean;

packages/angular_devkit/build_angular/src/builders/browser/schema.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@
201201
},
202202
"deployUrl": {
203203
"type": "string",
204-
"description": "URL where files will be deployed."
204+
"description": "URL where files will be deployed.",
205+
"x-deprecated": "Use \"baseHref\" option, \"APP_BASE_HREF\" DI token or a combination of both instead. For more information, see https://angular.io/guide/deployment#the-deploy-url."
205206
},
206207
"verbose": {
207208
"type": "boolean",

packages/angular_devkit/build_angular/src/builders/server/schema.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@
114114
},
115115
"deployUrl": {
116116
"type": "string",
117-
"description": "URL where files will be deployed."
117+
"description": "URL where files will be deployed.",
118+
"x-deprecated": "Use \"baseHref\" browser builder option, \"APP_BASE_HREF\" DI token or a combination of both instead. For more information, see https://angular.io/guide/deployment#the-deploy-url."
118119
},
119120
"verbose": {
120121
"type": "boolean",

0 commit comments

Comments
 (0)