mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-19 23:16:21 +00:00
🆕 Added support for JSON5
This commit is contained in:
+11
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user