-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[Fix] broken assets path #6962
[Fix] broken assets path #6962
Conversation
Introduces a new option in svelte config: rootRelativeAssets (boolean), which defaults to true, in order to restore previous functionality as a default.
|
- set `relativeAssets` default to false - adjust logic - adjustment of option placement in spec file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't seem like the right fix to me for a couple reasons
one is that we should make it work with relative assets
the other is that this seems to also be affecting laravel, so it's quite possibly an issue in vite-imagetools: JonasKruckenberg/imagetools#396
Can you check if JonasKruckenberg/imagetools#400 would fix the issue you're facing? |
Thank you for your input. You were right. |
Fixes #6326
This fixes broken usage of imagetools and possibly other vite plugins as well - when asset paths are used with the static adapter.
The breaking PR was #4250.
This fix introduces a new config option
rootRelativeAssets
relativeAssets
, which defaults totrue
false
, restoring the way things worked prior to the breaking PR, => namely: non-relative asset paths (or a "root-based asset path").EDIT: Changed option name and logic
This approach may or may not be the correct one and may be up for discussion or be rejected completely. For that reason, I have not written a test for that, yet. But I have tested the fix successfully on a project which suffered that issue.
If this is a viable fix, I'll gladly complete this PR with anything else needed.
...and thank you all for this amazing project 🥇
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. All changesets should bepatch
until SvelteKit 1.0