Skip to content

Commit 32f2754

Browse files
Charles Lydinghansl
Charles Lyding
authored andcommitted
fix(@angular/cli): standardize output path behavior
1 parent 0a2c1eb commit 32f2754

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

packages/@angular/cli/models/webpack-config.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ import {
1010
getNonAotConfig,
1111
getAotConfig
1212
} from './webpack-configs';
13-
14-
const path = require('path');
13+
import * as path from 'path';
1514

1615
export interface WebpackConfigOptions {
1716
projectRoot: string;
@@ -31,7 +30,7 @@ export class NgCliWebpackConfig {
3130

3231
appConfig = this.addAppConfigDefaults(appConfig);
3332
buildOptions = this.addTargetDefaults(buildOptions);
34-
buildOptions = this.mergeConfigs(buildOptions, appConfig);
33+
buildOptions = this.mergeConfigs(buildOptions, appConfig, projectRoot);
3534

3635
this.wco = { projectRoot, buildOptions, appConfig };
3736
}
@@ -94,9 +93,9 @@ export class NgCliWebpackConfig {
9493
}
9594

9695
// Fill in defaults from .angular-cli.json
97-
public mergeConfigs(buildOptions: BuildOptions, appConfig: any) {
96+
public mergeConfigs(buildOptions: BuildOptions, appConfig: any, projectRoot: string) {
9897
const mergeableOptions = {
99-
outputPath: appConfig.outDir,
98+
outputPath: path.resolve(projectRoot, appConfig.outDir),
10099
deployUrl: appConfig.deployUrl,
101100
baseHref: appConfig.baseHref
102101
};

packages/@angular/cli/models/webpack-configs/common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
7474
context: __dirname,
7575
entry: entryPoints,
7676
output: {
77-
path: path.resolve(projectRoot, buildOptions.outputPath),
77+
path: path.resolve(buildOptions.outputPath),
7878
publicPath: buildOptions.deployUrl,
7979
filename: `[name]${hashFormat.chunk}.bundle.js`,
8080
chunkFilename: `[id]${hashFormat.chunk}.chunk.js`

0 commit comments

Comments
 (0)