WIP - add extractor, generate snippet_data

This commit is contained in:
Stefan Fejes
2019-08-20 15:52:05 +02:00
parent 88084d3d30
commit cc8f1d8a7a
37396 changed files with 4588842 additions and 133 deletions

13
node_modules/mozjpeg/lib/index.js generated vendored Normal file
View File

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

36
node_modules/mozjpeg/lib/install.js generated vendored Normal file
View File

@ -0,0 +1,36 @@
'use strict';
const os = require('os');
const binBuild = require('bin-build');
const log = require('logalot');
const bin = require('.');
const cpuNum = os.cpus().length;
bin.run(['-version']).then(() => {
log.success('mozjpeg pre-build test passed successfully');
}).catch(error => {
log.warn(error.message);
log.warn('mozjpeg pre-build test failed');
log.info('compiling from source');
let cfgExtras = '';
if (process.platform === 'darwin') {
cfgExtras = 'libpng_LIBS=\'/usr/local/lib/libpng16.a -lz\' --enable-static';
}
const cfg = [
`./configure --enable-static --disable-shared --disable-dependency-tracking --with-jpeg8 ${cfgExtras}`,
`--prefix="${bin.dest()}" --bindir="${bin.dest()}" --libdir="${bin.dest()}"`
].join(' ');
binBuild.url('https://github.com/mozilla/mozjpeg/releases/download/v3.2/mozjpeg-3.2-release-source.tar.gz', [
'autoreconf -fiv',
cfg,
`make -j${cpuNum}`,
`make install -j${cpuNum}`
]).then(() => {
log.success('mozjpeg built successfully');
}).catch(error => {
log.error(error.stack);
});
});