fix: import problem

This commit is contained in:
ikechan8370 2023-02-25 16:03:29 +08:00
parent 07cd611568
commit 4bee340d24

View file

@ -58,7 +58,7 @@ async function resizeAndCropImage (inputFilePath, outputFilePath, size = 512) {
// Determine the maximum dimension of the input image // Determine the maximum dimension of the input image
let sharp let sharp
try { try {
sharp = await import('sharp') sharp = (await import('sharp')).default
} catch (e) { } catch (e) {
logger.error('sharp未安装请执行 pnpm install sharp@0.31.3') logger.error('sharp未安装请执行 pnpm install sharp@0.31.3')
throw new Error('sharp未安装请执行 pnpm install sharp@0.31.3') throw new Error('sharp未安装请执行 pnpm install sharp@0.31.3')