Skip to content

Commit 6a48794

Browse files
committed
fix(@schematics/angular): remove explicit outputPath option value from generated applications
The `outputPath` option now defaults to `dist/<project_name>` for applications. This removes the need to explicitly set the option within a newly generated project. The value removal also reduces the overall size of the `angular.json` configuration for new projects. Existing projects are not modified by this change.
1 parent 63428f3 commit 6a48794

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

packages/schematics/angular/application/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@ function addAppToWorkspaceFile(
236236
builder: Builders.BuildApplication,
237237
defaultConfiguration: 'production',
238238
options: {
239-
outputPath: `dist/${folderName}`,
240239
index: `${sourceRoot}/index.html`,
241240
browser: `${sourceRoot}/main.ts`,
242241
polyfills: options.experimentalZoneless ? [] : ['zone.js'],

packages/schematics/angular/ssr/index.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,9 @@ async function getApplicationBuilderOutputPaths(
8181
throw new SchematicsException(`Cannot find 'options' for ${projectName} ${target} target.`);
8282
}
8383

84-
const { outputPath } = architectTarget.options;
85-
if (outputPath === null || outputPath === undefined) {
86-
throw new SchematicsException(
87-
`outputPath for ${projectName} ${target} target is undefined or null.`,
88-
);
89-
}
84+
let { outputPath } = architectTarget.options;
85+
// Use default if not explicitly specified
86+
outputPath ??= posix.join('dist', projectName);
9087

9188
const defaultDirs = {
9289
server: DEFAULT_SERVER_DIR,

0 commit comments

Comments
 (0)