vite-plugin-minipic icon indicating copy to clipboard operation
vite-plugin-minipic copied to clipboard

常见问题及解决方法 (common Q&A)

Open 60late opened this issue 8 months ago • 5 comments

1.插件安装不成功(Install failed) 由于wall的原因,部分地区无法直接请求github上的镜像资源
在你全局或者项目的目录的.npmrc文件中增加以下内容

registry="https://registry.npmmirror.com"
sharp_binary_host="https://npm.taobao.org/mirrors/sharp"
sharp_libvips_binary_host="https://npm.taobao.org/mirrors/sharp-libvips"

2.打包时报错(require() of ES Module XX from XX not supported.) 是由于本插件引用的chalk,boxen等插件都是基于es module的 在package.json中加入以下代码可以解决

"type": "module",

或者,你可以把vite.config.js文件的后缀名修改为mjs,这个方法同样奏效

3.Public文件夹下的文件没有被压缩(Images in /public folder will not be compressed) 该问题已修复,把插件升级至>v1.1.0版本

60late avatar Oct 25 '23 06:10 60late