From bfe09f28a4e00b8e1c951310b33a0171ac4905d0 Mon Sep 17 00:00:00 2001 From: babayaga Date: Tue, 30 Dec 2025 09:58:29 +0100 Subject: [PATCH] library resources --- packages/imagetools_3/README.md | 6 ++++++ packages/imagetools_3/astroViteConfigs.js | 8 ++++---- packages/imagetools_3/utils/runtimeChecks.js | 8 ++++++++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/packages/imagetools_3/README.md b/packages/imagetools_3/README.md index eda0dbe..9932bd2 100644 --- a/packages/imagetools_3/README.md +++ b/packages/imagetools_3/README.md @@ -37,3 +37,9 @@ If you want to view live examples of the components, APIs, layouts, and placehol If you want to report any issues or have found a missing feature, please report it on [GitHub](https://github.com/RafidMuhymin/astro-imagetools/)! Good luck out there, Astronaut. 🧑‍🚀 + +### References + +https://wasm-vips.kleisauke.nl/playground/#smartcrop +https://www.libvips.org/2020/09/01/libvips-for-webassembly.html +https://sharp.pixelplumbing.com/performance/ diff --git a/packages/imagetools_3/astroViteConfigs.js b/packages/imagetools_3/astroViteConfigs.js index 613ad89..841e04a 100644 --- a/packages/imagetools_3/astroViteConfigs.js +++ b/packages/imagetools_3/astroViteConfigs.js @@ -1,12 +1,12 @@ export default { - "environment": "build", + "environment": "dev", "isSsrBuild": false, "projectBase": "", "publicDir": "C:\\Users\\zx\\Desktop\\polymech\\library.polymech\\public\\", "rootDir": "C:\\Users\\zx\\Desktop\\polymech\\library.polymech\\", - "mode": "production", - "outDir": "C:\\Users\\zx\\Desktop\\polymech\\library.polymech\\dist\\", - "assetsDir": "_astro", + "mode": "dev", + "outDir": "dist", + "assetsDir": "/_astro", "sourcemap": false, "assetFileNames": "/_astro/[name]@[width].[hash][extname]" } \ No newline at end of file diff --git a/packages/imagetools_3/utils/runtimeChecks.js b/packages/imagetools_3/utils/runtimeChecks.js index 2be5c08..9ee3fdb 100644 --- a/packages/imagetools_3/utils/runtimeChecks.js +++ b/packages/imagetools_3/utils/runtimeChecks.js @@ -9,6 +9,14 @@ import { resolve } from "@polymech/commons" import { sync as mkdir } from "@polymech/fs/dir" import { sync as exists } from "@polymech/fs/exists" +import os from "node:os"; + +// Boost libuv threadpool size on Windows for better sharp performance +// See: https://sharp.pixelplumbing.com/performance/ +if (os.platform() === "win32" && !process.env.UV_THREADPOOL_SIZE) { + process.env.UV_THREADPOOL_SIZE = "8"; +} + // Sharp related checks export const sharp = await (async () => { try {