diff --git a/packages/shiki/scripts/prepare/langs.ts b/packages/shiki/scripts/prepare/langs.ts index a8c862a05..4872bd56b 100644 --- a/packages/shiki/scripts/prepare/langs.ts +++ b/packages/shiki/scripts/prepare/langs.ts @@ -52,7 +52,7 @@ export async function prepareLangs() { `${COMMENT_HEAD} ${deps.map(i => `import ${i.replace(/\W/g, '_')} from './${i}'`).join('\n')} -const lang = Object.freeze(${JSON.stringify(json)}) +const lang = Object.freeze(JSON.parse(${JSON.stringify(JSON.stringify(json))})) export default [ ${[ diff --git a/packages/shiki/scripts/prepare/themes.ts b/packages/shiki/scripts/prepare/themes.ts index 16af30e0b..91a2ade40 100644 --- a/packages/shiki/scripts/prepare/themes.ts +++ b/packages/shiki/scripts/prepare/themes.ts @@ -10,7 +10,7 @@ export async function prepareTheme(): Promise { await fs.writeFile( `./src/assets/themes/${t.name}.js`, `${COMMENT_HEAD} -export default Object.freeze(${JSON.stringify(theme, null, 2)}) +export default Object.freeze(JSON.parse(${JSON.stringify(JSON.stringify(theme))})) `, 'utf-8', )