From 688472762e819747362e3e88d5322a8cdbf8a967 Mon Sep 17 00:00:00 2001 From: Ruslan <11838981+feedmeapples@users.noreply.github.com> Date: Tue, 26 Mar 2024 09:59:56 -0400 Subject: [PATCH] fix loading CommonJS lodash module (#108) --- packages/web/src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/web/src/index.ts b/packages/web/src/index.ts index 761ba5e..b97b3b8 100644 --- a/packages/web/src/index.ts +++ b/packages/web/src/index.ts @@ -8,7 +8,7 @@ export { }; export type { Config, ImageSource }; -import { memoize } from 'lodash'; +import lodash from 'lodash'; import ndarray from 'ndarray'; import { initInference, runInference } from './inference'; import { preload as preloadResources } from './resource'; @@ -16,6 +16,7 @@ import { Config, validateConfig } from './schema'; import * as utils from './utils'; import { ImageSource } from './utils'; +const { memoize } = lodash; const init = memoize(initInference, (config) => JSON.stringify(config)); async function preload(configuration?: Config): Promise {