最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to save remote images to local build in astroJS when generate build? - Stack Overflow

programmeradmin1浏览0评论

Example

I have AppImage.astro component as below

---
import { Image } from 'astro:assets';
---
<Image src=".jpg" alt="A bird." inferSize />

Now when i generate build i want to save images in build and serve images from there.

Edit

Answer

export default defineConfig({
    image: {
        remotePatterns: [{
            protocol: 'https',
            hostname: 'example', // your image source domain
          }],
    }
});
发布评论

评论列表(0)

  1. 暂无评论