问答详情
源自:4-7 处理图片以及其他文件

mac系统image-webpack-loader压缩图片一直报错

一堆这样的错误:node_modules/pngquant-bin/vendor/pngquant ENOENT

node_modules/mozjpeg/vendor/cjpeg ENOENT

上网查找解决办法,然后安装libpng

$ brew install libpng

Updating Homebrew...

^CWarning: libpng 1.6.34 is already installed

安装后还是继续报同样的错误,怎么办

注:我的代码:

{

test: /\.(png|jpg|svg|gif)$/i,

loaders: [

'url-loader?limit=20000&name=[name]-[hash:5].[ext]',

'image-webpack-loader'

]

}

提问者:yuqingzhijie3596863 2018-01-06 00:25

个回答