Skip to content

Commit

Permalink
Remove network request for pngquant src (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevcenteno authored and sindresorhus committed Jul 19, 2018
1 parent 42091a7 commit ae838c3
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
vendor/pngquant*
vendor/share*
yarn.lock
3 changes: 2 additions & 1 deletion lib/install.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use strict';
const path = require('path');
const binBuild = require('bin-build');
const logalot = require('logalot');
const bin = require('.');
Expand All @@ -11,7 +12,7 @@ bin.run(['--version'], err => {

const libpng = process.platform === 'darwin' ? 'libpng' : 'libpng-dev';

binBuild.url('http://pngquant.org/pngquant-2.10.1-src.tar.gz', [
binBuild.file(path.resolve(__dirname, '../vendor/src-pngquant/pngquant-2.10.1-src.tar.gz'), [
'rm ./INSTALL',
`./configure --prefix="${bin.dest()}"`,
`make install BINPREFIX="${bin.dest()}"`
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"files": [
"cli.js",
"index.js",
"lib"
"lib",
"vendor/src-pngquant"
],
"keywords": [
"imagemin",
Expand Down
2 changes: 1 addition & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const m = require('.');
test('rebuild the pngquant binaries', async t => {
const tmp = tempy.directory();

await binBuild.url('http://pngquant.org/pngquant-2.10.1-src.tar.gz', [
await binBuild.file(path.resolve(__dirname, 'vendor/src-pngquant/pngquant-2.10.1-src.tar.gz'), [
'rm ./INSTALL',
`./configure --prefix="${tmp}"`,
`make install BINPREFIX="${tmp}"`
Expand Down
Binary file added vendor/src-pngquant/pngquant-2.10.1-src.tar.gz
Binary file not shown.

0 comments on commit ae838c3

Please sign in to comment.