Skip to content

Static Assets

Static asset in your modules with common extensions will resolve to public URLs automatically:

javascript
import myImage from './myImage.png';

export default function MyComponent() {
  return <img src={myImage} />;
}
import myImage from './myImage.png';

export default function MyComponent() {
  return <img src={myImage} />;
}

See Vite’s static asset documentation for more information.