What is the `public/` directory in Nuxt.js?

Answer

The public/ directory contains static assets that are served directly at the root URL without any processing by Vite or Nitro. Files placed here are accessible as-is: a file at public/logo.png is available at /logo.png. This is the right place for robots.txt, favicon.ico, static images, and other files that don't need bundling or transformation. It differs from assets/, which is processed by Vite — assets there can be imported in components and have their URLs hashed for cache busting. Use public/ when you need a stable, predictable URL.