Skip to content

Commit

Permalink
better handling for astro metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
natemoo-re committed Nov 9, 2022
1 parent 6bd2154 commit c2707d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/astro/src/vite-plugin-scanner/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ export default function astroScannerPlugin({ settings }: { settings: AstroSettin
}

const { meta = {} } = this.getModuleInfo(id) ?? {};
if (!meta.astro) meta.astro = { hydratedComponents: [], clientOnlyComponents: [], scripts: [], pageOptions: {} };
meta.astro.pageOptions = pageOptions;
if (!meta.astro) meta.astro = { hydratedComponents: [], clientOnlyComponents: [], scripts: [], pageOptions: pageOptions };
if (!meta.astro.pageOptions) meta.astro.pageOptions = pageOptions;

return {
code,
Expand Down

0 comments on commit c2707d1

Please sign in to comment.