Skip to content
This repository has been archived by the owner on Nov 13, 2022. It is now read-only.

Use document.baseURI instead of location #6

Open
LarsDenBakker opened this issue Mar 15, 2020 · 0 comments
Open

Use document.baseURI instead of location #6

LarsDenBakker opened this issue Mar 15, 2020 · 0 comments

Comments

@LarsDenBakker
Copy link

LarsDenBakker commented Mar 15, 2020

When using SPA routing, you don't want module import URLs to change when the browser URL changes. If you use document.baseURI instead of location to resolve imports relatively, it takes the document <base href="..."> into account. This mimics the behaviour of other relative requests in the browser.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant