Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibility that the generated paths for the files start with a dot ./ #2695

Closed
firewave-remo opened this issue Oct 27, 2021 · 1 comment

Comments

@firewave-remo
Copy link

firewave-remo commented Oct 27, 2021

Describe the problem

I would like to run some pages from a subdirectory that can change over time so it would be nice that the generated paths for the files start with "./" instead of "/". So the browser would start from the current location where he found the index.html

Edit: Another use case would be Electron which needs the dot in front of the files to work with the file protocol.

Describe the proposed solution

I would like that all the files that are part of the generated index.html to start with ./

so instead of

		<link rel="modulepreload" href="/_app/start-c7530576.js">
		<link rel="modulepreload" href="/_app/chunks/vendor-af0f2ef7.js">
		<link rel="modulepreload" href="/_app/layout.svelte-c0349d46.js">
		<link rel="modulepreload" href="/_app/pages/index.svelte-aeab2da5.js">
		<link rel="stylesheet" href="/_app/assets/start-61d1577b.css">
		<link rel="stylesheet" href="/_app/assets/pages/index.svelte-e7349f54.css">

I would like to have

		<link rel="modulepreload" href="./_app/start-c7530576.js">
		<link rel="modulepreload" href="./_app/chunks/vendor-af0f2ef7.js">
		<link rel="modulepreload" href="./_app/layout.svelte-c0349d46.js">
		<link rel="modulepreload" href="./_app/pages/index.svelte-aeab2da5.js">
		<link rel="stylesheet" href="./_app/assets/start-61d1577b.css">
		<link rel="stylesheet" href="./_app/assets/pages/index.svelte-e7349f54.css">

Alternatives considered

none

Importance

I cannot use sveltekit without it

Additional Information

If there is already a possibility that would be nice. I have played around with the paths property, but it seems that it does not allow what I would like to have. I have used the static adapter if that makes a difference.

Edit:
Just checked the vite docs. Vite would allow me to do exactly this and its also mentioned in the docs https://vitejs.dev/config/#base

@benmccann
Copy link
Member

Sounds like a duplicate of #907

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

No branches or pull requests

2 participants