I was given the task to set up our application to run with a root context. Instead of http://somehost/index.html, it should run with http://somehost/ourapp/index.html. I was able to set this up with Angular correctly using the command line options base-href and deploy-url:
ng build --prod --base-href /ourapp --deploy-url /ourapp/
The application is deployed to IBM IHS (basically Apache) in a subfolder called “ourapp” in the document root. The application can be reached fine with http://host/ourapp, but the ion-searchbar cannot find its own icon, the console prints:
GET http://host/svg/ios-search.svg 404 (Not Found)
, which makes sense because the icons are actually at http://host/ourapp/svg/ios-search.svg.
This is what I have in angular.json for these assets:
“assets”: [
{
“glob”: “/*",
“input”: “src/assets”,
“output”: “assets”
},
{
“glob”: "/*.svg”,
“input”: “node_modules/ionicons/dist/ionicons/svg”,
“output”: “./svg”
},
And these are the relevant versions (I just got this from another developer so I’m not sure if this makes sense):
“dependencies”: {
"@angular/common": "~8.1.2",
"@angular/compiler": "~8.1.2",
"@angular/core": "~8.1.2",
"@angular/forms": "~8.1.2",
"@angular/platform-browser": "~8.1.2",
"@angular/platform-browser-dynamic": "~8.1.2",
"@angular/pwa": "^0.803.16",
"@angular/router": "~8.1.2",
"@angular/service-worker": "~8.1.2",
"@ionic-native/core": "^5.0.0",
"@ionic-native/splash-screen": "^5.0.0",
"@ionic-native/status-bar": "^5.0.0",
"@ionic/angular": "^4.7.1",
Is there some additional configuration I need to take care of for Ionic to find the icons in the correct location?
Thanks,
Peter
1 post - 1 participant