🆕 Added support for JSON5

This commit is contained in:
duckietm
2026-05-18 16:13:09 +02:00
parent e209146f47
commit b2318b9e7c
3 changed files with 325 additions and 319 deletions
+11 -1
View File
@@ -1,3 +1,4 @@
import JSON5 from 'json5';
import { configFileUrl, getClientMode, installSecureFetch } from './secure-assets';
const ensureMobileViewport = () =>
@@ -74,7 +75,16 @@ const loadClientMode = async () =>
if(!response.ok) throw new Error(`HTTP ${ response.status }`);
(window as any).__nitroClientMode = await response.json();
const text = await response.text();
try
{
(window as any).__nitroClientMode = JSON.parse(text);
}
catch
{
(window as any).__nitroClientMode = JSON5.parse(text);
}
setBootDebug('boot: client-mode loaded');
}
catch(error)