-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
manifest.json
file collision
#9636
Comments
This file is written using Rollup's
There are two solutions I can think of:
As a workaround, we could potentially generate a random string and name the file something like It's also rather weird for this file to be located in the output directory where it will be served to users. We may end up deleting it at the end of the SvelteKit build to avoid that, but that's annoying for troubleshooting and it'd be nicer if it were located elsewhere |
Perhaps we can change the default to |
Or rather should we have a separate We will write the manifest directory inside the parent dir of Problem is this is not consistent if Edit: it seems rollup |
We could write the manifest with |
But that won't show up in the build log. |
What's the build log and why should we care about the manifest being there? The alternative would be to file a report with Rollup and see if they'll change the behavior of |
What about |
I like the idea of using a (cc @jessarcher @ElMassimo @brillout maybe this is interesting to you too, specially if you see an issue with us changing the default in the next major) |
To confirm, we probably want to output |
@bluwy yes, I think we should keep it in the |
How about this? Without SSR:
With SSR:
This means Vite always writes the client to I know that some will find it "ugly" (because is some cases the extra |
Oh I added the
This could be tricky with the |
I was thinking of only one top-level hidden folder for Vite artifacts:
And maybe others in the future. This is independent of the way users do their dist setup. |
I agree with the idea of @patak-dev using I also think
It might be confusing at first, but the output directories looks good tho. |
Making that exception when it contains a slash might make it harder for tooling to infer the correct location. I prefer the simpler proposal of using
|
We discussed this issue with the team and we think it is a good idea to move forward with scoping vite build artifacts to a new
We should do this in Vite 5 to avoid disruption in the ecosystem. But projects could start configuring the manifest name already to be A side effect of this change could be that some servers are going to refuse to serve these files. We see this as a positive outcome (it could avoid the need for manually deleting these files), but the ecosystem as a whole should test that this change doesn't have other unintended consequences. |
Describe the bug
If you set
build.manifest: true
and have a file namedmanifest.json
in thepublicDir
then themanifest.json
file will be overwritten.As a framework, we can set the name of
build.manifest
to something else, but it's impossible to know in advance all the possible file names our users may have.Originally reported in sveltejs/kit#5803
Reproduction
Visit http://localhost:5173/manifest.json in the browser and see the Vite manifest rather than the file in
static/manifest.json
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: