Skip to content

Commit 9b682e6

Browse files
committed
feat(@angular/build): support a default outputPath option for applications
The application builder will now use a default output path when the `outputPath` option is not specified either in the `angular.json` configuration or via the command line. The default used will be `dist/<project_name>` and be relative to the workspace root. This value is the typical default for new projects. Projects may continue to customize the output path via the option if needed. Existing project behavior and configuration will not be changed.
1 parent 156a14e commit 9b682e6

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

goldens/public-api/angular/build/index.api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export type ApplicationBuilderOptions = {
4949
optimization?: OptimizationUnion;
5050
outputHashing?: OutputHashing;
5151
outputMode?: OutputMode;
52-
outputPath: OutputPathUnion;
52+
outputPath?: OutputPathUnion;
5353
poll?: number;
5454
polyfills?: string[];
5555
prerender?: PrerenderUnion;

packages/angular/build/src/builders/application/options.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ export async function normalizeOptions(
295295
};
296296
}
297297

298-
const outputPath = options.outputPath;
298+
const outputPath = options.outputPath ?? path.join(workspaceRoot, 'dist', projectName);
299299
const outputOptions: NormalizedOutputOptions = {
300300
browser: 'browser',
301301
server: 'server',

packages/angular/build/src/builders/application/schema.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@
605605
}
606606
},
607607
"additionalProperties": false,
608-
"required": ["outputPath", "index", "browser", "tsConfig"],
608+
"required": ["index", "browser", "tsConfig"],
609609
"definitions": {
610610
"assetPattern": {
611611
"oneOf": [

0 commit comments

Comments
 (0)