-
-
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
remove Vite static asset middleware #4535
Conversation
🦋 Changeset detectedLatest commit: 33fa8f5 The changes in this PR will be included in the next version bump. 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 |
Co-authored-by: Mihael Mutić <35368241+PH4NTOMiki@users.noreply.github.com>
I'm not completely clear on what this new approach is doing, but the changeset and the test description should probably be updated. |
updated those descriptions |
Could you explain why this was changed? The last iteration made sense to me whereas this iteration does not |
The static middleware is needed to serve things like image files in |
Seems like this breaks assets imported as urls used in development mode, i.e before
worked in dev mode under |
Noticed in #1634 (and I can't believe this hasn't come up sooner) that Vite will serve assets in the
static
folder, with that prefix — so/favicon.png
can also be requested as/static/favicon.png
.Fixed by removing
viteServeStaticMiddleware
in the plugin (which, aside: this feels like a massive code smell and an indication that the design of the Vite dev server isn't optimal for the SSR framework use case).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
pnpx changeset
and following the prompts. All changesets should bepatch
until SvelteKit 1.0