From bd21b3db75e8a635b5257350e7a9d64d87d45b56 Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Wed, 1 Nov 2023 18:32:56 +0100 Subject: [PATCH] Ensure versions.json is distributed --- .gitignore | 1 + build.sh | 5 ++++- package.json | 22 +++++++++++++--------- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index cd96fd9f1..f5036735e 100644 --- a/.gitignore +++ b/.gitignore @@ -77,6 +77,7 @@ dist/ # User-specific stuff package-lock.json +versions.json build/deps/ build/target/ build/enums.cpp diff --git a/build.sh b/build.sh index d5df551ca..cc87af5e7 100755 --- a/build.sh +++ b/build.sh @@ -537,5 +537,8 @@ EOF # Copy dynamic loadable modules module_dir=$(printf '%s\n' $TARGET/lib/vips-modules-* | sort -n | tail -1) - [ -d "$module_dir" ] && cp $module_dir/* $SOURCE_DIR/lib/ || true + [ -d "$module_dir" ] && cp $module_dir/* $SOURCE_DIR/lib || true + + # Copy versions.json + cp $TARGET/versions.json $SOURCE_DIR ) diff --git a/package.json b/package.json index 5a09ffe97..d6e586710 100644 --- a/package.json +++ b/package.json @@ -14,15 +14,18 @@ "author": "Kleis Auke Wolthuizen", "type": "commonjs", "exports": { - "browser": { - "import": "./lib/vips-es6.js", - "require": "./lib/vips.js" + ".": { + "browser": { + "import": "./lib/vips-es6.js", + "require": "./lib/vips.js" + }, + "node": { + "import": "./lib/vips-node.mjs", + "require": "./lib/vips-node.js" + }, + "default": "./lib/vips.js" }, - "node": { - "import": "./lib/vips-node.mjs", - "require": "./lib/vips-node.js" - }, - "default": "./lib/vips.js" + "./versions": "./versions.json" }, "main": "lib/vips-node.js", "browser": "lib/vips.js", @@ -35,7 +38,8 @@ "lib/vips-heif.wasm", "lib/vips-jxl.wasm", "lib/vips-resvg.wasm", - "THIRD-PARTY-NOTICES.md" + "THIRD-PARTY-NOTICES.md", + "versions.json" ], "scripts": { "build": "docker build -t wasm-vips . && docker run -it --rm -v $(pwd):/src wasm-vips ./build.sh",