__ion-dev-server scripts injecting is not compatible with path locationStrategy #1059
Description
Note: for support questions, please use one of these channels:
https://forum.ionicframework.com/
http://ionicworldwide.herokuapp.com/
Short description of the problem:
I'm using path location strategy in Ionic app:
IonicModule.forRoot(MyApp, {
locationStrategy: 'path'
}),
with nested IonicPage segments (ex. /users/add
). All scripts (like chunks 0.main.js etc) are loaded by realitve paths so in my example browser tries to load /users/build/0.main.js
. This can be fixed just by adding <base href="/">
at the top of <head>
. But in ionic serve
there are scripts injected just at the top of of <head>
so they're always before <base href="/">
, so they're 404'ed:
<link href="__ion-dev-server/ion-dev.css?v=1.3.8" rel="stylesheet">
<script src="__ion-dev-server/ion-dev.js?v=1.3.8"></script>
What behavior are you expecting?
If all the script should be loaded by relative paths (as it is now), __ion-dev-server should be injected at the end of </head>
Steps to reproduce:
- Set locationStrategy to
path
in your app config - Add page with nested segment (ex.
/users/add
) -(but I'm using nested tabs view) ionic serve
- Open nested page by entering url
http://localhost:8100/users/add
- in console you'll see 404 for all js and css files
insert any relevant code between the above and below backticks
Which @ionic/app-scripts version are you using?
1.3.8
Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)