mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Upgrade to libvips v8.7.0
Drop Node 4 support Add experimental musl prebuild for Node 8 and 10
This commit is contained in:
@@ -44,10 +44,16 @@ const globalLibvipsVersion = function () {
|
||||
|
||||
const hasVendoredLibvips = function () {
|
||||
const currentPlatformId = platform();
|
||||
const vendorPath = path.join(__dirname, '..', 'vendor');
|
||||
let vendorVersionId;
|
||||
let vendorPlatformId;
|
||||
try {
|
||||
vendorPlatformId = require(path.join(__dirname, '..', 'vendor', 'platform.json'));
|
||||
vendorVersionId = require(path.join(vendorPath, 'versions.json')).vips;
|
||||
vendorPlatformId = require(path.join(vendorPath, 'platform.json'));
|
||||
} catch (err) {}
|
||||
if (vendorVersionId && vendorVersionId !== minimumLibvipsVersion) {
|
||||
throw new Error(`Found vendored libvips v${vendorVersionId} but require v${minimumLibvipsVersion}. Please remove the 'node_modules/sharp/vendor' directory and run 'npm install'.`);
|
||||
}
|
||||
if (vendorPlatformId) {
|
||||
if (currentPlatformId === vendorPlatformId) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user