diff --git a/docs/documentation/build.md b/docs/documentation/build.md
index 20b765306349..41aecaee79eb 100644
--- a/docs/documentation/build.md
+++ b/docs/documentation/build.md
@@ -304,7 +304,7 @@ See https://github.com/angular/angular-cli/issues/7797 for details.
--preserve-symlinks
- Do not use the real path when resolving modules.
+ Do not use the real path when resolving modules. If unset then will default to `true` if NodeJS option --preserve-symlinks is set.
diff --git a/docs/documentation/test.md b/docs/documentation/test.md
index 5b00f3286c71..f1309ad32ebe 100644
--- a/docs/documentation/test.md
+++ b/docs/documentation/test.md
@@ -123,7 +123,7 @@ You can run tests with coverage via `--code-coverage`. The coverage report will
--preserve-symlinks
- Do not use the real path when resolving modules.
+ Do not use the real path when resolving modules. If unset then will default to `true` if NodeJS option --preserve-symlinks is set.
diff --git a/packages/angular/cli/lib/config/schema.json b/packages/angular/cli/lib/config/schema.json
index e08fae417a23..70bc0b745760 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. If unset then will default to `true` if NodeJS option --preserve-symlinks is set."
},
"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. If unset then will default to `true` if NodeJS option --preserve-symlinks is set."
},
"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. 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/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/packages/schematics/angular/utility/config.ts b/packages/schematics/angular/utility/config.ts
index 5b72c4d4f5ed..308ff63ac8e4 100644
--- a/packages/schematics/angular/utility/config.ts
+++ b/packages/schematics/angular/utility/config.ts
@@ -388,7 +388,8 @@ export interface CliConfig {
*/
deleteOutputPath?: boolean;
/**
- * Do not use the real path when resolving modules.
+ * Do not use the real path when resolving modules. If unset then will default to `true` if NodeJS option --preserve-symlinks is
+ * set.
*/
preserveSymlinks?: boolean;
/**
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..4c68ca3e2d84 100644
--- a/tests/angular_devkit/core/json/schema/serializers/schema_benchmark.json
+++ b/tests/angular_devkit/core/json/schema/serializers/schema_benchmark.json
@@ -479,9 +479,8 @@
"default": true
},
"preserveSymlinks": {
- "description": "Do not use the real path when resolving modules.",
- "type": "boolean",
- "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.",
+ "type": "boolean"
},
"showCircularDependencies": {
"description": "Show circular dependency warnings on builds.",