You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Handling of the public directory is too opinionated for SSR builds, needlessly copying assets to dist despite those files being available to the server at root level.
a) favicon.svg and other_file.css being copied to the root level of the dist folder (default behavour)
b) favicon.svg being copied to the dist/assets folder with a hashed filename.
c) other_file.css link entry being removed from the index file.
Suggested solution
Allow option to disable copying files from the public directory, while also ignoring /public/* entries in index.html
Alternative
There is none as of now. Renaming the public directory or changing the publicDir config to a non-existent directory solves a), but not b) and c). Currently there's no way to keep the index.html links intact and avoid copying other linked files.
The text was updated successfully, but these errors were encountered:
Because that is not how you should structure a Vite SSR project. In production, you should be serving files in the dist directory, not your project root. Everything outside dist is considered source file.
This issue has been locked since it has been closed for more than 14 days.
If you have found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest Vite version. If you have any other comments you should join the chat at Vite Land or create a new discussion.
Clear and concise description of the problem
Handling of the
public
directory is too opinionated for SSR builds, needlessly copying assets todist
despite those files being available to the server at root level.Using a common pattern
Then linking the assets in the
index.html
vite build
will result ina)
favicon.svg
andother_file.css
being copied to the root level of thedist
folder (default behavour)b)
favicon.svg
being copied to thedist/assets
folder with a hashed filename.c)
other_file.css
link entry being removed from the index file.Suggested solution
Allow option to disable copying files from the
public
directory, while also ignoring/public/*
entries inindex.html
Alternative
There is none as of now. Renaming the public directory or changing the
publicDir
config to a non-existent directory solves a), but not b) and c). Currently there's no way to keep the index.html links intact and avoid copying other linked files.The text was updated successfully, but these errors were encountered: