Skip to content

refactor (build): refactor the logic to set publicPath #4090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/angular-cli/models/webpack-build-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export function getWebpackCommonConfig(
progress: boolean,
outputHashing: string,
extractCss: boolean,
deployUrl: string
) {

const appRoot = path.resolve(projectRoot, appConfig.root);
Expand Down Expand Up @@ -149,7 +150,7 @@ export function getWebpackCommonConfig(
entry: entryPoints,
output: {
path: path.resolve(projectRoot, appConfig.outDir),
publicPath: appConfig.deployUrl,
publicPath: deployUrl,
filename: `[name]${hashFormat.chunk}.bundle.js`,
sourceMapFilename: `[name]${hashFormat.chunk}.bundle.map`,
chunkFilename: `[id]${hashFormat.chunk}.chunk.js`
Expand Down
2 changes: 1 addition & 1 deletion packages/angular-cli/models/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export class NgCliWebpackConfig {
const projectRoot = this.ngCliProject.root;

appConfig.outDir = outputDir || appConfig.outDir;
appConfig.deployUrl = deployUrl || appConfig.deployUrl;

let baseConfig = getWebpackCommonConfig(
projectRoot,
Expand All @@ -53,6 +52,7 @@ export class NgCliWebpackConfig {
progress,
outputHashing,
extractCss,
deployUrl
);
let targetConfigPartial = this.getTargetConfig(projectRoot, appConfig, sourcemap, verbose);

Expand Down