Skip to content

Commit 07d9ba4

Browse files
committed
refactor (build): refactor the logic to set publicPath
1 parent 2677138 commit 07d9ba4

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/angular-cli/models/webpack-build-common.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export function getWebpackCommonConfig(
3535
progress: boolean,
3636
outputHashing: string,
3737
extractCss: boolean,
38+
deployUrl: string
3839
) {
3940

4041
const appRoot = path.resolve(projectRoot, appConfig.root);
@@ -149,7 +150,7 @@ export function getWebpackCommonConfig(
149150
entry: entryPoints,
150151
output: {
151152
path: path.resolve(projectRoot, appConfig.outDir),
152-
publicPath: appConfig.deployUrl,
153+
publicPath: deployUrl,
153154
filename: `[name]${hashFormat.chunk}.bundle.js`,
154155
sourceMapFilename: `[name]${hashFormat.chunk}.bundle.map`,
155156
chunkFilename: `[id]${hashFormat.chunk}.chunk.js`

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ export class NgCliWebpackConfig {
4040
const projectRoot = this.ngCliProject.root;
4141

4242
appConfig.outDir = outputDir || appConfig.outDir;
43-
appConfig.deployUrl = deployUrl || appConfig.deployUrl;
4443

4544
let baseConfig = getWebpackCommonConfig(
4645
projectRoot,
@@ -53,6 +52,7 @@ export class NgCliWebpackConfig {
5352
progress,
5453
outputHashing,
5554
extractCss,
55+
deployUrl
5656
);
5757
let targetConfigPartial = this.getTargetConfig(projectRoot, appConfig, sourcemap, verbose);
5858

0 commit comments

Comments
 (0)