Skip to content

Commit

Permalink
Fix type issue?
Browse files Browse the repository at this point in the history
  • Loading branch information
rijkvanzanten committed Jul 26, 2023
1 parent 6e12bf1 commit 3242350
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/dynamicAsset.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const dynamicAsset = (path: string) => {
const assets = import.meta.glob('~/assets/**/*', { eager: true });
const assets = import.meta.glob<{ default?: string }>('~/assets/**/*', { eager: true });
const fullPath = `/assets` + path;
return assets[fullPath]?.default;
return assets?.[fullPath]?.default;
};

0 comments on commit 3242350

Please sign in to comment.