From 611a57c6a85169ee570732d5e539dd0a6c2ec182 Mon Sep 17 00:00:00 2001 From: Fabian Wiles Date: Fri, 17 Jan 2020 05:21:46 +0000 Subject: [PATCH] feat(@angular-devkit/build-angular): default to NodeJS value for preserveSymlinks --- packages/angular/cli/lib/config/schema.json | 9 +++------ .../angular_devkit/build_angular/src/browser/schema.json | 3 +-- .../angular_devkit/build_angular/src/karma/schema.json | 3 +-- .../angular_devkit/build_angular/src/server/schema.json | 3 +-- .../build_angular/src/utils/normalize-builder-schema.ts | 2 +- .../core/json/schema/serializers/schema_benchmark.json | 3 +-- 6 files changed, 8 insertions(+), 15 deletions(-) diff --git a/packages/angular/cli/lib/config/schema.json b/packages/angular/cli/lib/config/schema.json index e08fae417a23..aad5a2e42bd0 100644 --- a/packages/angular/cli/lib/config/schema.json +++ b/packages/angular/cli/lib/config/schema.json @@ -844,8 +844,7 @@ }, "preserveSymlinks": { "type": "boolean", - "description": "Do not use the real path when resolving modules.", - "default": false + "description": "Do not use the real path when resolving modules." }, "extractLicenses": { "type": "boolean", @@ -1478,8 +1477,7 @@ }, "preserveSymlinks": { "type": "boolean", - "description": "Do not use the real path when resolving modules.", - "default": false + "description": "Do not use the real path when resolving modules." }, "browsers": { "type": "string", @@ -1855,8 +1853,7 @@ }, "preserveSymlinks": { "type": "boolean", - "description": "Do not use the real path when resolving modules.", - "default": false + "description": "Do not use the real path when resolving modules." }, "extractLicenses": { "type": "boolean", diff --git a/packages/angular_devkit/build_angular/src/browser/schema.json b/packages/angular_devkit/build_angular/src/browser/schema.json index 61c659e7d861..40bbae344d2c 100644 --- a/packages/angular_devkit/build_angular/src/browser/schema.json +++ b/packages/angular_devkit/build_angular/src/browser/schema.json @@ -248,8 +248,7 @@ }, "preserveSymlinks": { "type": "boolean", - "description": "Do not use the real path when resolving modules.", - "default": false + "description": "Do not use the real path when resolving modules. If unset then will default to `true` if NodeJS option --preserve-symlinks is set." }, "extractLicenses": { "type": "boolean", diff --git a/packages/angular_devkit/build_angular/src/karma/schema.json b/packages/angular_devkit/build_angular/src/karma/schema.json index 79f2df99decf..569658441d67 100644 --- a/packages/angular_devkit/build_angular/src/karma/schema.json +++ b/packages/angular_devkit/build_angular/src/karma/schema.json @@ -126,8 +126,7 @@ }, "preserveSymlinks": { "type": "boolean", - "description": "Do not use the real path when resolving modules.", - "default": false + "description": "Do not use the real path when resolving modules. If unset then will default to `true` if NodeJS option --preserve-symlinks is set." }, "browsers": { "type": "string", diff --git a/packages/angular_devkit/build_angular/src/server/schema.json b/packages/angular_devkit/build_angular/src/server/schema.json index dfdbc43ebbb8..00ea91ce0537 100644 --- a/packages/angular_devkit/build_angular/src/server/schema.json +++ b/packages/angular_devkit/build_angular/src/server/schema.json @@ -198,8 +198,7 @@ }, "preserveSymlinks": { "type": "boolean", - "description": "Do not use the real path when resolving modules.", - "default": false + "description": "Do not use the real path when resolving modules. If unset then will default to `true` if NodeJS option --preserve-symlinks is set." }, "extractLicenses": { "type": "boolean", diff --git a/packages/angular_devkit/build_angular/src/utils/normalize-builder-schema.ts b/packages/angular_devkit/build_angular/src/utils/normalize-builder-schema.ts index 6941e7d2ad04..55e601844723 100644 --- a/packages/angular_devkit/build_angular/src/utils/normalize-builder-schema.ts +++ b/packages/angular_devkit/build_angular/src/utils/normalize-builder-schema.ts @@ -53,7 +53,7 @@ export function normalizeBrowserSchema( fileReplacements: normalizeFileReplacements(options.fileReplacements || [], syncHost, root), optimization: normalizeOptimization(options.optimization), sourceMap: normalizedSourceMapOptions, - + preserveSymlinks: options.preserveSymlinks === undefined ? process.execArgv.includes('--preserve-symlinks') : options.preserveSymlinks, statsJson: options.statsJson || false, forkTypeChecker: options.forkTypeChecker || false, budgets: options.budgets || [], diff --git a/tests/angular_devkit/core/json/schema/serializers/schema_benchmark.json b/tests/angular_devkit/core/json/schema/serializers/schema_benchmark.json index 90f18d86fcd7..8fae654a21db 100644 --- a/tests/angular_devkit/core/json/schema/serializers/schema_benchmark.json +++ b/tests/angular_devkit/core/json/schema/serializers/schema_benchmark.json @@ -480,8 +480,7 @@ }, "preserveSymlinks": { "description": "Do not use the real path when resolving modules.", - "type": "boolean", - "default": false + "type": "boolean" }, "showCircularDependencies": { "description": "Show circular dependency warnings on builds.",