You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 15, 2023. It is now read-only.
I'm sure this breaks the builds of many other newcomers to Svelte:
After npm run build, both deployment of the public folder as well as running index.html in the browser fails, because the links to all root-relative.
So the only way Svelte can be deployed with the template as it is currently, is in the document root of a webserver.
As it works perfectly with relative links both in the root and from any other location (both over a webserver and using the file protocol locall), and I see no downside of using them, I submit a pull request to make the links relative. Please correct me if I'm wrong here.
The text was updated successfully, but these errors were encountered:
P.S.: I don't normally create pull requests, please tell me if I there is anything I should do differently in the pull request workflow.
KonradHoeffner
changed the title
Leading slash (root relative links) in index.html break deployment
Leading slash (root relative links) in index.html break deployment outside of document root
Apr 27, 2021
The purpose of the absolute paths is to support single-page apps, where the js/css files won't necessarily be in the current directory as the browser understands it. We could maybe improve the readme, but I don't think we should simply change the URLs.
Maybe I understand something wrongly here, but isn't a single-page app one where there is just a single index.html file in the public folder where the paths work out? I would expect this problem to only occur in a multi-page app, where there are multiple pages in different folders and folder nesting depths.
I'm sure this breaks the builds of many other newcomers to Svelte:
After
npm run build
, both deployment of thepublic
folder as well as runningindex.html
in the browser fails, because the links to all root-relative.So the only way Svelte can be deployed with the template as it is currently, is in the document root of a webserver.
As it works perfectly with relative links both in the root and from any other location (both over a webserver and using the file protocol locall), and I see no downside of using them, I submit a pull request to make the links relative. Please correct me if I'm wrong here.
The text was updated successfully, but these errors were encountered: