refactor(vite): imagemin

This commit is contained in:
菲鸽
2024-02-19 16:40:19 +08:00
parent bb2ea2669a
commit e0b02436ac
6 changed files with 1772 additions and 43 deletions

View File

@@ -5,15 +5,24 @@
}
</route>
<template lang="">
<script setup lang="ts">
import testBgImg from './test-bg.png'
</script>
<template>
<view class="m-4 text-center">
<view class="mb-2 text-orange-500">
原始图片是一个很大的2.5Mbuild之后生成的图片只有1.1M体积下降 56%
</view>
<!-- #ifdef MP -->
<image
src="https://cip-shopping-page-0eysug01066a9e-1302818703.tcloudbaseapp.com/fly/img-min/bg-1.png"
mode="scaleToFill"
/>
<!-- #endif -->
<!-- #ifndef MP -->
<image :src="testBgImg" mode="scaleToFill" />
<!-- #endif -->
<view class="mb-4">对比图如下2图如果看不清请看代码原图</view>
<image
src="https://cip-shopping-page-0eysug01066a9e-1302818703.tcloudbaseapp.com/fly/img-min/before.png"

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB