Skip to content

Commit 01745e9

Browse files
vips: inline spread for conditional JXL dynamic library
Replace the three-line mutable array build with an inline spread so the dynamicLibraries value is visible at the call site.
1 parent 0da9827 commit 01745e9

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

packages/vips/src/index.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,14 @@ async function getVips(): Promise< typeof Vips > {
5858
return await vipsPromise;
5959
}
6060

61-
const dynamicLibraries = [ 'vips-heif.wasm' ];
62-
if ( jxlWasmUrl ) {
63-
dynamicLibraries.push( 'vips-jxl.wasm' );
64-
}
65-
6661
vipsPromise = Vips( {
6762
// Load HEIF dynamic module for HEIF/HEIC and AVIF format support.
6863
// JXL is loaded conditionally when the wp-vips-jxl canonical plugin
6964
// provides the WASM URL.
70-
dynamicLibraries,
65+
dynamicLibraries: [
66+
'vips-heif.wasm',
67+
...( jxlWasmUrl ? [ 'vips-jxl.wasm' ] : [] ),
68+
],
7169
locateFile: ( fileName: string ) => {
7270
// WASM files are inlined as base64 data URLs at build time,
7371
// eliminating the need for separate file downloads and avoiding

0 commit comments

Comments
 (0)