forked from external-repos/squoosh
@@ -13,12 +13,12 @@
|
||||
import type { AVIFModule } from 'codecs/avif/enc/avif_enc';
|
||||
import type { EncodeOptions } from '../shared/meta';
|
||||
import { initEmscriptenModule } from 'features/worker-utils';
|
||||
import { threads } from 'wasm-feature-detect';
|
||||
import checkThreadsSupport from 'worker-shared/supports-wasm-threads';
|
||||
|
||||
let emscriptenModule: Promise<AVIFModule>;
|
||||
|
||||
async function init() {
|
||||
if (await threads()) {
|
||||
if (await checkThreadsSupport()) {
|
||||
const avifEncoder = await import('codecs/avif/enc/avif_enc_mt');
|
||||
return initEmscriptenModule<AVIFModule>(avifEncoder.default);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user