Skip to content

Commit

Permalink
Set viteConfigFile property correctly in config()
Browse files Browse the repository at this point in the history
  • Loading branch information
szymmis committed Jan 2, 2024
1 parent 35a660c commit 5de1e86
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 5de1e86

Please sign in to comment.