-
Notifications
You must be signed in to change notification settings - Fork 12k
add support for publicPath option in webpack #3136
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
Conversation
Changing the base href doesn't do what you need? |
Hi, using base href works kind of. The problem with using base href is that it will also affect ajax calls which in my case is not what i want ... |
You can either use root relative urls or provide an app wide config object with an api base url which can be prefixed to all ajax calls (good practice anyway in case the static content is split from the API in the future). The nice thing about setting the base href is that it handles index.html, webpack, and angular routing all in one place. |
Yes, that works. Thanks! But it doesn't feel correct to me though since my Btw, my application structure looks like this:
|
After playing a little bit more with I prepared two demos which demonstrate the difference between The If you compare this with the @clydin, do you know a way i can archive this without Thanks in advance, |
Add this to your app module:
As to the PR, I think that two options that perform similar functions but with slightly different outcomes could lead to confusion. Some guides on different hosting strategies would probably be useful regardless. |
Thanks again! |
@Mischi |
Hi @jbellmann, the solution @clydin proposed works for my current project but if you care i can reopen it. |
The solution from @clydin doesn't work in my case. I definitely need publicPath supported. |
please notice my PR into your feature-branch. Contains only the missing test. |
@andyg3 feel free to open an issue to discuss your use case |
# Conflicts: # packages/angular-cli/models/webpack-build-common.ts
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm. |
130d5c4
to
87b0b3e
Compare
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
@here I signed the CLA, but somehow the @googlebot is not checking again. |
Is there a way to kick the @googlebot into re-checking this? |
Is there any update with this? I really need publicPath support. |
I merged latest changes from master and created a PR for your feature-branch. Is there an easier way to handle this? Regards, |
I really need publicPath support as well. Will be great to get this merged in. |
I think this one can be closed |
Superseded by #3285, as it is more complete. |
…3285) Add publicPath option for webpack. User can specify publicPath via `--deploy-url` / `-d` from command line or add `deployUrl` to `angular-cli.json`. It can solve following issues: Change the public URL address of the output files (different from baseUrl). Manipulate the request url for chunk js files. It is very helpful to solve resources url and route lazying load issues for those applications which have different static files paths such as ASP.NET MVC. Fixes #3136 Fixes #2960 Fixes #2276 Fixes #2241 Fixes #3344
…ngular#3285) Add publicPath option for webpack. User can specify publicPath via `--deploy-url` / `-d` from command line or add `deployUrl` to `angular-cli.json`. It can solve following issues: Change the public URL address of the output files (different from baseUrl). Manipulate the request url for chunk js files. It is very helpful to solve resources url and route lazying load issues for those applications which have different static files paths such as ASP.NET MVC. Fixes angular#3136 Fixes angular#2960 Fixes angular#2276 Fixes angular#2241 Fixes angular#3344
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Hi all,
this PR tries to add the publicPath option for webpack.
I have not figured out how to test this feature yet? Would be happy for any suggestions though 😃
Personally i would like to use this feature to easily integrate angular-cli based projects into ASP.NET MVC applications but there are many other valid use cases for publicPath option. See BROCKHAUS-AG/AspNetAngular2IntegrationDemo for a simple demo ...
This should also fix #2276.
Cheers,
Fabian