35 字
1 分钟
vite 打包图片压缩插件
vite-plugin-imagemin 有点慢,换成 unplugin-imagemin/vite
地址:https://github.com/unplugin/unplugin-imagemin
pnpm add unplugin-imagemin@latest -D
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import imagemin from "unplugin-imagemin/vite";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), imagemin()],
});