0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-02-10 22:38:53 -05:00

fix: vite warning on load-astro-config

This commit is contained in:
bholmesdev 2024-01-18 18:20:25 -05:00 committed by Nate Moore
parent 8ea2c8778d
commit d7b76b9638

View file

@ -45,7 +45,9 @@ function search(root: string) {
async function loadConfigWithVite(configPath: string): Promise<Record<string, unknown>> {
if (/\.[cm]?js$/.test(configPath)) {
try {
const config = await import(pathToFileURL(configPath).toString() + '?t=' + Date.now());
const config = await import(
/* @vite-ignore */ pathToFileURL(configPath).toString() + '?t=' + Date.now()
);
return config.default ?? {};
} catch (e) {
// We do not need to throw the error here as we have a Vite fallback below