Modern Images

将图片转换为 WebP、AVIF 等现代格式,支持响应式 srcset、磁盘缓存和 LCP 预加载。

插件

Modern Images

将图片转换为 WebP、AVIF 等现代格式,支持响应式 srcset、磁盘缓存和 LCP 预加载。

  • 分类: 媒体
  • 状态: 可用
  • 版本: 1.3.0
  • 价格: 未知
  • 来源: npm 软件包
  • 安装方式: npm 原生集成
  • 核实日期: 2026-11-01

将图片转换为 WebP、AVIF 等现代格式,支持响应式 srcset、磁盘缓存和 LCP 预加载。

安装

从 npm 安装该软件包:

npm install emdash-plugin-modern-images

在 Astro 配置中注册该插件:

import { modernImagesPlugin } from "emdash-plugin-modern-images";

export default defineConfig({
  integrations: [
    emdash({
      plugins: [modernImagesPlugin()],
    }),
  ],
});

详细信息