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
perf: only have Vite generate relative paths when required #10287
Conversation
🦋 Changeset detectedLatest commit: 2525a0e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Are we sure that will work correctly in all environments? I'm a bit surprised that everything works as expected today. Why did we not forward the base path to Vite when building before? Like, if you serve your app from |
I can't think of a reason it'd break and all our tests pass. I can't think of anything I'd do to gain more confidence in it. If it does break we can revert it and add a test to prevent future regression
|
Where in the build output can I see the difference. For example in kit.svelte.dev, if I look at the hero image code, where would I see the difference? Right now I'm not seing any when flipping |
There's no difference on kit.svelte.dev because it sets kit/sites/kit.svelte.dev/svelte.config.js Line 11 in a7bffde
|
I know, but I commented it out and it didn't make a difference. So how can I construct an example to see the difference? |
Ah! Thanks for testing. It turns out Vite has an undocumented behavior of also treating before
after
|
I tested this some more on preview and ran into an unrelated problem I thought is worth to write down (maybe we should create a Svelte issue from this). The problem is that the |
I just ran into a problem using @sveltejs/kit@1.22.1 that I think is related to this change: If you use adapter-static and set a custom base path, the |
If you're deploying in a subfolder you probably should set |
Even after sveltejs/svelte#8868 is merged this is still a bit better for performance in the case that you're not using relative paths.