Skip to content

Commit

Permalink
perf(plugin-blog): improve performance
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Jan 15, 2025
1 parent f851b6a commit 0c5115a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const prepareCategoriesMap = async (
await app.writeTemp(
`blog/category.js`,
`\
export const categoriesMap = ${JSON.stringify(categoriesMap)};
export const categoriesMap = JSON.parse(${JSON.stringify(JSON.stringify(categoriesMap))});
${app.env.isDev ? HMR_CODE : ''}
`,
)
Expand Down
2 changes: 1 addition & 1 deletion plugins/blog/plugin-blog/src/node/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const prepareStore = async (app: App, store: Store): Promise<void> => {
await app.writeTemp(
`blog/store.js`,
`\
export const store = ${store.toJSON()};
export const store = JSON.parse(${JSON.stringify(store.toJSON())});
`,
)
}
2 changes: 1 addition & 1 deletion plugins/blog/plugin-blog/src/node/type/prepareTypesMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const prepareTypesMap = async (
await app.writeTemp(
`blog/type.js`,
`\
export const typesMap = ${JSON.stringify(typesMapData)};
export const typesMap = JSON.parse(${JSON.stringify(JSON.stringify(typesMapData))});
${app.env.isDev ? HMR_CODE : ''}
`,
)
Expand Down

0 comments on commit 0c5115a

Please sign in to comment.