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

Conversation

changLiuUNSW
Copy link
Contributor

@changLiuUNSW changLiuUNSW commented Jan 18, 2017

If we set deployUrl via the angular-cli.json, the ng serve will be affected as well because we set publicPath via appConfig.deployUrl in the webpack-build-common.ts

This PR can solve above issue and also remove duplicated logic deployUrl || appConfig.deployUrl; which already exists in build-webpack.ts

Copy link
Contributor

@filipesilva filipesilva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix also removes the functionality of using deployUrl via the config file though.

If that functionality is to be removed, then the code for it in the config needs to be removed as well.

@changLiuUNSW
Copy link
Contributor Author

changLiuUNSW commented Jan 18, 2017

@filipesilva This fix will not remove functionality of using deployUrl via the config.
You can see below logic from build-webpack.ts

const deployUrl = runTaskOptions.deployUrl ||
                       CliConfig.fromProject().config.apps[0].deployUrl;

https://github.com/angular/angular-cli/blob/master/packages/angular-cli/tasks/build-webpack.ts#L17

We also have e2e test to cover the functionality of using deployUrl via the config here:
https://github.com/angular/angular-cli/blob/master/tests/e2e/tests/build/deploy-url.ts#L9

The test passed with my change

@filipesilva
Copy link
Contributor

Ok I understand now. I'm working on a big PR to refactor how these commands work though, so I'll try to introduce this logic there as well in case this doesn't get merged before.

@filipesilva
Copy link
Contributor

Superseded by #4105

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants