Frontend
Assets
Three kinds of asset, three clear homes: one entry stylesheet that is linked for you, component-local assets imported through short aliases, and a public directory copied to the build root untouched.
#The entry stylesheet
The main stylesheet is auto-linked into the document, so a single import point styles the whole app. Its path is a config key; the default is /assets/css/index.css.
export default defineConfig({
builder: { input: { mainCSS: '/assets/css/index.css' } } // auto-linked
})#Component assets via aliases
Import images and other assets in components through stable aliases instead of brittle relative paths. Each alias maps to a subfolder of the assets directory, resolved for both the client and the SSR build.
import mark from '@img/logo.svg' // resolves to assets/img/logo.svg
export function Logo () {
return <img src={mark} alt='Tasks' width={32} height={32} />
}#The public directory
Files that must ship verbatim at the site root, robots.txt, llms.txt, a CNAME, favicons, go in public/. It is copied as-is to the build output; nothing processes it.
| Location | Type | Description |
|---|---|---|
| assets/css/index.css | entry CSS | Auto-linked application stylesheet. |
| @img, @fonts, ... | import aliases | Component asset imports, mapped to assets/ subfolders. |
| public/ | verbatim | Copied to the build root untouched (robots.txt, llms.txt, favicons). |