Skip to content

Commit aab502f

Browse files
authoredJan 15, 2025··
perf(plugin-blog): improve performance (#341)
1 parent d7eb312 commit aab502f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed
 

‎plugins/blog/plugin-blog/src/node/category/prepareCategoriesMap.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const prepareCategoriesMap = async (
2424
await app.writeTemp(
2525
`blog/category.js`,
2626
`\
27-
export const categoriesMap = ${JSON.stringify(categoriesMap)};
27+
export const categoriesMap = JSON.parse(${JSON.stringify(JSON.stringify(categoriesMap))});
2828
${app.env.isDev ? HMR_CODE : ''}
2929
`,
3030
)

‎plugins/blog/plugin-blog/src/node/store.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const prepareStore = async (app: App, store: Store): Promise<void> => {
3838
await app.writeTemp(
3939
`blog/store.js`,
4040
`\
41-
export const store = ${store.toJSON()};
41+
export const store = JSON.parse(${JSON.stringify(store.toJSON())});
4242
`,
4343
)
4444
}

‎plugins/blog/plugin-blog/src/node/type/prepareTypesMap.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const prepareTypesMap = async (
2121
await app.writeTemp(
2222
`blog/type.js`,
2323
`\
24-
export const typesMap = ${JSON.stringify(typesMapData)};
24+
export const typesMap = JSON.parse(${JSON.stringify(JSON.stringify(typesMapData))});
2525
${app.env.isDev ? HMR_CODE : ''}
2626
`,
2727
)

0 commit comments

Comments
 (0)
Please sign in to comment.