Skip to content

Commit

Permalink
imagemin#107 add env var support for binary site
Browse files Browse the repository at this point in the history
  • Loading branch information
romain-perez24 authored and rohm1 committed Mar 24, 2021
1 parent 8231b7e commit 1d8b3b5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ const path = require('path');
const BinWrapper = require('bin-wrapper');
const pkg = require('../package.json');

const url = `https://raw.githubusercontent.com/imagemin/pngquant-bin/v${pkg.version}/vendor/`;
const site = process.env.PNGQUANT_BINARY_SITE ||
process.env.npm_config_pngquant_binary_site ||
'https://raw.githubusercontent.com';

const url = `${site}/imagemin/pngquant-bin/v${pkg.version}/vendor/`;

module.exports = new BinWrapper()
.src(`${url}macos/pngquant`, 'darwin')
Expand Down

0 comments on commit 1d8b3b5

Please sign in to comment.