public
Serve static files without importing them into Vue code.
Put files that must keep their name and be served directly from the site root in public/.
public/
├── favicon.svg → /favicon.svg
└── robots.txt → /robots.txtReference them with an absolute URL from the root:
<img src="/logo.svg" alt="Acme" />For images imported by a component and optimized by Vite, prefer a source directory such as app/assets/ and a JavaScript import.
You can relocate or disable this directory:
export default defineConfig({
publicDir: "static",
// publicDir: false,
});Use false when your backend, a proxy, or a CDN already serves every static file.