Skip to content

Commit a6ac43a

Browse files
Charles Lydinghansl
Charles Lyding
authored andcommitted
fix(@angular/cli): standardize output path behavior
1 parent 29a7e3f commit a6ac43a

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

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

+4-5
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ import {
1111
getNonAotConfig,
1212
getAotConfig
1313
} from './webpack-configs';
14-
15-
const path = require('path');
14+
import * as path from 'path';
1615

1716
export interface WebpackConfigOptions {
1817
projectRoot: string;
@@ -32,7 +31,7 @@ export class NgCliWebpackConfig {
3231

3332
appConfig = this.addAppConfigDefaults(appConfig);
3433
buildOptions = this.addTargetDefaults(buildOptions);
35-
buildOptions = this.mergeConfigs(buildOptions, appConfig);
34+
buildOptions = this.mergeConfigs(buildOptions, appConfig, projectRoot);
3635

3736
this.wco = { projectRoot, buildOptions, appConfig };
3837
}
@@ -106,9 +105,9 @@ export class NgCliWebpackConfig {
106105
}
107106

108107
// Fill in defaults from .angular-cli.json
109-
public mergeConfigs(buildOptions: BuildOptions, appConfig: any) {
108+
public mergeConfigs(buildOptions: BuildOptions, appConfig: any, projectRoot: string) {
110109
const mergeableOptions = {
111-
outputPath: appConfig.outDir,
110+
outputPath: path.resolve(projectRoot, appConfig.outDir),
112111
deployUrl: appConfig.deployUrl,
113112
baseHref: appConfig.baseHref
114113
};

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
9797
context: __dirname,
9898
entry: entryPoints,
9999
output: {
100-
path: path.resolve(projectRoot, buildOptions.outputPath),
100+
path: path.resolve(buildOptions.outputPath),
101101
publicPath: buildOptions.deployUrl,
102102
filename: `[name]${hashFormat.chunk}.bundle.js`,
103103
chunkFilename: `[id]${hashFormat.chunk}.chunk.js`

0 commit comments

Comments
 (0)