importviteImageminfrom"vite-unplugin-imagemin";exportdefault()=>{return{plugins:[viteImagemin({dirs:"./dist/build"})],};}; Options paramstypedefaultdefault dirsstring-build folder Readme Keywords none npm ivite-unplugin-imagemin Weekly Downloads ...
Sure, this is my vite config: importfsfrom'node:fs'import{URL,fileURLToPath}from'node:url'importvuefrom'@vitejs/plugin-vue'importAutoImportfrom'unplugin-auto-import/vite'importIconsResolverfrom'unplugin-icons/resolver'importIconsfrom'unplugin-icons/vite'importimageminfrom'unplugin-imagemin/vite'im...
npm i vite-plugin-compression -D vite.config.ts import { defineConfig,loadEnv} from 'vite' import viteCompression from 'vite-plugin-compression'; export default ({ mode }) => defineConfig({ plugins: [ viteCompression() ] }) vite-plugin-imagemin 打包压缩图片 安装 npm i vite-plugin-imagemi...
import{createEsbuildPlugin,createRollupPlugin,createRspackPlugin,createVitePlugin,createWebpackPlugin}from'unplugin'constvitePlugin=createVitePlugin({/* options */})constrollupPlugin=createRollupPlugin({/* options */})constesbuildPlugin=createEsbuildPlugin({/* options */})constwebpackPlugin=createWebpa...