[solved] Aurelia 2 - How to set an empty `base href=""`, doesn't work with empty `basePath`

So I’m making the switch to Aurelia 2 for my plugin and I got everything working except that since I’m publishing the website on GitHub, I need to set the base to be empty as base href="" (without any slash). So, I tried with basePath: '', or basePath: '.' or basePath: './' but they all produce base href="/"which is totally invalid in GitHub since that goes outside the GitHub project repo and breaks the website demo. It really needs to be empty for GitHub Page, so what is the fix for this? For now I’m manually editing the base and I remove the slash, but I hope to fix this in my code and let the CI do its job automatically

My current code is

Aurelia.register(
    RouterConfiguration.customize({ useHref: false, basePath: './' }),
);

I guess I could use basePath: '/aurelia-slickgrid' but I wish to be able to set empty string instead, I was able to achieve that in Aurelia 1, so I would like to be able to do the same in Aurelia 2

EDIT

Actually it turns out that I had an index.html defined with a static base href="/" causing the issue.

2 Likes