<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>图片 on PlumePHP</title><link>https://plumephp.com/tags/%E5%9B%BE%E7%89%87/</link><description>Recent content in 图片 on PlumePHP</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Mon, 28 Sep 2026 10:00:00 +0800</lastBuildDate><atom:link href="https://plumephp.com/tags/%E5%9B%BE%E7%89%87/index.xml" rel="self" type="application/rss+xml"/><item><title>Vite 静态资源与媒体资产处理：图片、字体、SVG 与 Worker</title><link>https://plumephp.com/vite-asset-processing/</link><pubDate>Mon, 28 Sep 2026 10:00:00 +0800</pubDate><guid>https://plumephp.com/vite-asset-processing/</guid><description>&lt;h2 id="引言"&gt;引言&lt;/h2&gt;
&lt;p&gt;Vite 里的静态资源（图片、字体、SVG、Worker）有一套&lt;strong&gt;看似自动、实则有很多开关&lt;/strong&gt;的处理管线：为什么小图会被内联成 Base64、大图会被加 hash、&lt;code&gt;public/&lt;/code&gt; 下的文件又完全不处理？本文把 Vite 的资产管线讲透：先讲 &lt;code&gt;assetsInlineLimit&lt;/code&gt; 与资源哈希的内联/外链决策，再讲图片的正确姿势（&lt;code&gt;publicDir&lt;/code&gt; vs &lt;code&gt;import&lt;/code&gt;、懒加载、压缩），接着讲字体（格式、子集化、&lt;code&gt;font-display&lt;/code&gt;）、SVG（文件 vs 组件 vs 雪碧图）、Worker 的加载（&lt;code&gt;new Worker&lt;/code&gt; 的 Vite 原生支持、模块 Worker），最后给一套资源治理清单与常见排查。&lt;/p&gt;</description></item></channel></rss>