修改了源后yarn config set registry https://registry.npm.taobao.orgwebpack-image-loader依赖的bin文件还是下载不下来
但是直接cnpm install webpack-image-loader 就能将 gifsicle 下载下来
其实这部操作是要从const url = https://raw.githubusercontent.com/imagemin/gifsicle-bin/v${pkg.version}/vendor/;拉取文件
具体可查看imagemin/gifsicle-bin
用cnpm拉取下来的_gifsicle@3.0.4@gifsicle仓库的lib/index.js文件的url地址呗cnpm给替换了
'use strict';
var path = require('path');
var BinWrapper = require('bin-wrapper');
var pkg = require('../package.json');
var url = 'https://raw.github.cnpmjs.org/imagemin/gifsicle-bin/v' + pkg.version + '/vendor/';
module.exports = new BinWrapper()
.src(url + 'macos/gifsicle', 'darwin')
.src(url + 'linux/x86/gifsicle', 'linux', 'x86')
.src(url + 'linux/x64/gifsicle', 'linux', 'x64')
.src(url + 'freebsd/x86/gifsicle', 'freebsd', 'x86')
.src(url + 'freebsd/x64/gifsicle', 'freebsd', 'x64')
.src(url + 'win/x86/gifsicle.exe', 'win32', 'x86')
.src(url + 'win/x64/gifsicle.exe', 'win32', 'x64')
.dest(path.join(__dirname, '../vendor'))
.use(process.platform === 'win32' ? 'gifsicle.exe' : 'gifsicle');
@i5ting @xcatliu