bundling theme now works and so are bundled style's palettes

This commit is contained in:
Henry Jameson 2024-11-19 03:18:52 +02:00
commit 313eb8f4cd
8 changed files with 171 additions and 106 deletions

View file

@ -226,7 +226,7 @@ export const applyConfig = (input, i18n) => {
}
}
export const getResourcesIndex = async (url) => {
export const getResourcesIndex = async (url, parser = JSON.parse) => {
const cache = 'no-store'
try {
@ -243,8 +243,9 @@ export const getResourcesIndex = async (url) => {
k,
() => window
.fetch(v, { cache })
.then((data) => data.json())
.catch((e) => {
.then(data => data.text())
.then(text => parser(text))
.catch(e => {
console.error(e)
return null
})