Uh oh!
There was an error while loading. Please reload this page.
add support for publicPath option in webpack - #3136
Conversation
clydin
commented
Nov 14, 2016
Changing the base href doesn't do what you need? |
Mischi
commented
Nov 14, 2016
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. |
Mischi
commented
Nov 15, 2016
Yes, that works. Thanks! But it doesn't feel correct to me though since my Btw, my application structure looks like this:
|
Mischi
commented
Nov 15, 2016
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, |
clydin
commented
Nov 16, 2016
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. |
Mischi
commented
Nov 16, 2016
Thanks again! |
jbellmann
commented
Nov 17, 2016
@Mischi |
Mischi
commented
Nov 18, 2016
Hi @jbellmann, the solution @clydin proposed works for my current project but if you care i can reopen it. |
andyg3
commented
Nov 18, 2016
The solution from @clydin doesn't work in my case. I definitely need publicPath supported. |
jbellmann
commented
Nov 18, 2016
please notice my PR into your feature-branch. Contains only the missing test. |
clydin
commented
Nov 18, 2016
@andyg3 feel free to open an issue to discuss your use case |
# Conflicts: # packages/angular-cli/models/webpack-build-common.ts
googlebot
commented
Nov 19, 2016
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. |
googlebot
commented
Nov 19, 2016
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
87b0b3eComparegooglebot
commented
Nov 19, 2016
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. |
jbellmann
commented
Nov 21, 2016
@here I signed the CLA, but somehow the @googlebot is not checking again. |
andyg3
commented
Nov 21, 2016
Is there a way to kick the @googlebot into re-checking this? |
Is there any update with this? I really need publicPath support. |
jbellmann
commented
Nov 24, 2016
I merged latest changes from master and created a PR for your feature-branch. Is there an easier way to handle this? Regards, |
rsnj
commented
Nov 24, 2016
I really need publicPath support as well. Will be great to get this merged in. |
I think this one can be closed |
filipesilva
commented
Dec 8, 2016
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#3136Fixes#2960Fixes#2276Fixes#2241Fixes#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. Fixesangular#3136Fixesangular#2960Fixesangular#2276Fixesangular#2241Fixesangular#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. |
…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. Fixesangular#3136Fixesangular#2960Fixesangular#2276Fixesangular#2241Fixesangular#3344
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