From 5de1e86680c5f6c4f5691a5b779bb3a56838aa7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20Mi=C5=9Btal?= Date: Tue, 2 Jan 2024 21:18:21 +0100 Subject: [PATCH] Set viteConfigFile property correctly in config() --- src/main.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index b9d7791..66124a5 100644 --- a/src/main.ts +++ b/src/main.ts @@ -64,7 +64,9 @@ function getDefaultViteConfig(): ViteConfig { } function getViteConfigPath() { - if (fs.existsSync("vite.config.js")) return "vite.config.js"; + if (Config.viteConfigFile && fs.existsSync(Config.viteConfigFile)) + return Config.viteConfigFile; + else if (fs.existsSync("vite.config.js")) return "vite.config.js"; else if (fs.existsSync("vite.config.ts")) return "vite.config.ts"; throw new Error("Unable to locate Vite config"); } @@ -282,6 +284,7 @@ function config(config: ConfigurationOptions) { Config.ignorePaths = config.ignorePaths; Config.inlineViteConfig = config.inlineViteConfig; Config.transformer = config.transformer; + Config.viteConfigFile = config.viteConfigFile; } async function bind(