Assets and Files
There are two ways to add an asset to your Redwood app:
- co-locate it with the component using it and import it into the component as if it were code
- add it to the
web/publicdirectory and reference it relative to your site's root
Where possible, prefer the first strategy.
It lets Vite include the asset in the bundle when the file is small enough.
Co-locating and Importing Assets
Let's say you want to show your app's logo in your Header component.
First, add your logo to the Header component's directory:
web/src/components/Header/
├── logo.png