From 79cc272ab2975cc337fd0b92eee0f1e61d7acbaf Mon Sep 17 00:00:00 2001 From: Hex Date: Mon, 27 May 2024 00:42:19 +0800 Subject: [PATCH] fix: add missing mkdir recursive option (#28) Co-authored-by: Fateh AK --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 68829f9..9833c72 100644 --- a/src/index.ts +++ b/src/index.ts @@ -176,7 +176,7 @@ function ViteImageOptimizer(optionsParam: Options = {}): Plugin { const ensureCacheDirectoryExists = async function () { if (options.cache === true && !fs.existsSync(options.cacheLocation)) { - await fsp.mkdir(options.cacheLocation); + await fsp.mkdir(options.cacheLocation, { recursive: true }); } };