remove Option "deployUrl" is deprecated warning
See original GitHub issueI add this issue again. Before someone close it (again), please answer this - https://stackoverflow.com/q/71548735/2896495. How should I make the dist to have scripts point to the right folder (ngxapp
):
<script src="/ngxapp/runtime.js" type="module"></script>
I use the following command to build my angular app and publish it with a back-end made using .NET:
ng build --base-href /%folder% --deploy-url /%folder%/ --configuration=production
And it’s a bit annoying to see this warning:
Option “deployUrl” is deprecated: Use “baseHref” option, “APP_BASE_HREF” DI token or a combination of both instead. For more information, see https://angular.io/guide/deployment#the-deploy-url.
There’s no way deployUrl
is deprecated. Please remove this warning.
OS: Windows 11
Issue Analytics
- State:
- Created a year ago
- Comments:17
Top Results From Across the Web
What is best way to go about replacing 'deployUrl' in angular ...
Option "deployUrl" is deprecated: Use "baseHref" option, "APP_BASE_HREF" DI token or a combination of both instead. For more information, see ...
Read more >Deprecated APIs and features - Angular
This section contains a complete list all of the currently deprecated CLI flags. @angular-devkit/build-angularlink. API/Option, May be removed in, Details ...
Read more >ng serve - Angular
Option Description Value Type Default Value
‑‑hmr Enable hot module replacement. boolean false
‑‑host Host to listen on. string localhost
‑‑open Opens the url in default...
Read more >Removed or deprecated platform features | Dynamics 365
This article describes features that have been removed, or that are planned for removal in platform updates of finance and operations apps.
Read more >ng build - Angular
Delete the output path before building. Default: true. --deployUrl= deployUrl. URL where files will be deployed.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@alan-agius4 with the deprecation of
deployUrl
what’s your suggested workaround for SSR applications? The entire application can not be on a CDN, albeit, it’s better that the assets be hosted on a CDN.Deprecating
deployUrl
simply because it decreases the build speed, while leaving out an important edge case does not seem quite fitting. My suggestion would be to leave the option and not recommend it for most cases. The trade-off in increased build times for faster assets delivery can be worth it.Thanks Alan, so if I understood correctly the proposed solution we have to overwrite the value of base href with the APP_BASE_HREF Token, but will that not affect as well the loading of the elements?
Our elements are distributed as part of the assets folder /assets/elements/remote-el-xyz
ng b --base-href=“http://cdn-url.com/” { provide: APP_BASE_HREF, useValue: ‘/myapp’ }
Our host app is merely a shell all the modules are elements that get dynamically loaded.
We are not able to to host fully on CDN due to data protection policy for the API calls to not leave the DC, static assets are fine, no sensitive data, but backend calls contain sensitive data, hence the use of the reverse proxy.
The previous syntax seemed more obvious, base-href for app, deploy-url for assets, clear separation of concerns. Now it will require additional insight to understand what APP_BASE_HREF does.
In any case, thank you for the proposed solution we will try and see if we hit any hickups.