fix: fix AVIF/JXL support

we need to copy the vips-*.wasm files from node_modules into vite's workers folder
This commit is contained in:
JovannMC 2025-02-15 13:53:59 +03:00
parent e9ea02198f
commit 582f99588f
No known key found for this signature in database
3 changed files with 7 additions and 3 deletions

View File

@ -34,8 +34,8 @@ export class VipsConverter extends Converter {
".tiff",
".jfif",
//".heif", HEIF files that are encoded like HEIC files (and HEIC files in general) aren't supported due to https://github.com/kleisauke/wasm-vips/issues/3
//".avif", there is an issue with vite not bundling the wasm-vips' dynamicLibraries wasm files correctly
//".jxl",
".avif",
".jxl",
];
public readonly reportsProgress = false;

View File

@ -1,6 +1,6 @@
import Vips from "wasm-vips";
const vipsPromise = Vips({ dynamicLibraries: [] });
const vipsPromise = Vips();
vipsPromise
.then(() => {

View File

@ -38,6 +38,10 @@ export default defineConfig({
src: "_headers",
dest: "",
},
{
src: "node_modules/wasm-vips/lib/vips-*.wasm",
dest: "_app/immutable/workers",
},
],
}),
],