Skip to content

Commit

Permalink
fix(parser): parsed components should store as object
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Sep 10, 2024
1 parent 09a96cd commit db7943a
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,16 @@ export function useComponentMetaParser (
}

const getStringifiedComponents = () => {
const _components = Object.keys(components).map((key) => ({
...components[key],
fullPath: undefined,
shortPath: undefined,
export: undefined
}))
return JSON.stringify(_components, null, 2)
const _components = Object.keys(components).map((key) => ([
key,
{
...components[key],
fullPath: undefined,
shortPath: undefined,
export: undefined
}
]))
return JSON.stringify(Object.fromEntries(_components), null, 2)
}

const getVirtualModuleContent = () => `export default ${getStringifiedComponents()}`
Expand Down

0 comments on commit db7943a

Please sign in to comment.