imagemin / mozjpeg-bin

mozjpeg bin-wrapper that makes it seamlessly available as a local dependency

Home Page:https://github.com/mozilla/mozjpeg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Please add environment variable to set bin download URL

peixin opened this issue · comments

like node-sass can set sass-binary-site to download bin library.

function getBinaryUrl() {
  var site = getArgument('--sass-binary-site') ||
             process.env.SASS_BINARY_SITE  ||
             process.env.npm_config_sass_binary_site ||
             (pkg.nodeSassConfig && pkg.nodeSassConfig.binarySite) ||
             'https://github.com/sass/node-sass/releases/download';

  return [site, 'v' + pkg.version, getBinaryName()].join('/');
}

For some reason in china download from github is very slow.

We usually install package from https://npm.taobao.org/mirrors

pngquant-bin: https://npm.taobao.org/mirrors/pngquant-bin/
mozjpeg-bin: https://npm.taobao.org/mirrors/mozjpeg-bin/
cwebp-bin: https://npm.taobao.org/mirrors/cwebp-bin/

commented

jsdelivr works fine in China, so I forked this package, see https://github.com/imagemin-bin-jsdelivr/mozjpeg-bin
And, use mozjpeg-jsdelivr package name instead.

for temporary use only.