This commit is contained in:
2021-11-21 11:18:28 +01:00
parent 7a358eb836
commit 230b10b2a3
9339 changed files with 892519 additions and 62 deletions

18
node_modules/optipng-bin/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
'use strict';
const path = require('path');
const BinWrapper = require('bin-wrapper');
const packageJson = require('../package.json');
const url = `https://raw.githubusercontent.com/imagemin/optipng-bin/v${packageJson.version}/vendor/`;
module.exports = new BinWrapper()
.src(`${url}macos/optipng`, 'darwin')
.src(`${url}linux/x86/optipng`, 'linux', 'x86')
.src(`${url}linux/x64/optipng`, 'linux', 'x64')
.src(`${url}freebsd/x86/optipng`, 'freebsd', 'x86')
.src(`${url}freebsd/x64/optipng`, 'freebsd', 'x64')
.src(`${url}sunos/x86/optipng`, 'sunos', 'x86')
.src(`${url}sunos/x64/optipng`, 'sunos', 'x64')
.src(`${url}win/optipng.exe`, 'win32')
.dest(path.resolve(__dirname, '../vendor'))
.use(process.platform === 'win32' ? 'optipng.exe' : 'optipng');

31
node_modules/optipng-bin/lib/install.js generated vendored Normal file
View File

@@ -0,0 +1,31 @@
'use strict';
const path = require('path');
const binBuild = require('bin-build');
const log = require('logalot');
const bin = require('.');
(async () => {
try {
await bin.run(['--version']);
log.success('optipng pre-build test passed successfully');
} catch (error) {
log.warn(error.message);
log.warn('optipng pre-build test failed');
log.info('compiling from source');
try {
// From https://sourceforge.net/projects/optipng/files/OptiPNG/
await binBuild.file(path.resolve(__dirname, '../vendor/source/optipng.tar.gz'), [
`./configure --with-system-zlib --prefix="${bin.dest()}" --bindir="${bin.dest()}"`,
'make install'
]);
log.success('optipng built successfully');
} catch (error) {
log.error(error.stack);
// eslint-disable-next-line unicorn/no-process-exit
process.exit(1);
}
}
})();