From ca4472463b3d156b1e8c024d48861491d119e814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Fayot?= Date: Fri, 12 May 2023 12:37:34 +0200 Subject: [PATCH] fix: vite root directory not taken into account when set --- src/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index ff4ba25..048383b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -37,7 +37,11 @@ export default function vitePluginCesium(options: VitePluginCesiumOptions = {}): if (base === '') base = './'; } if (c.build?.outDir) { - outDir = c.build.outDir; + if (c.root !== undefined) { + outDir = path.join(c.root, c.build.outDir); + } else { + outDir = c.build.outDir; + } } CESIUM_BASE_URL = path.posix.join(base, CESIUM_BASE_URL); const userConfig: UserConfig = {};