Skip to content

Commit

Permalink
fix: glob for single content extension
Browse files Browse the repository at this point in the history
  • Loading branch information
bholmesdev committed Feb 16, 2023
1 parent f4e171c commit b2ea6c2
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ export function astroContentVirtualModPlugin({
);
const contentEntryExts = getContentEntryExts(settings);

const entryGlob = `${relContentDir}**/*{${contentEntryExts.join(',')}}`;
const extGlob =
contentEntryExts.length === 1
? // Wrapping {...} breaks when there is only one extension
contentEntryExts[0]
: `{${contentEntryExts.join(',')}}`;
const entryGlob = `${relContentDir}**/*${extGlob}`;
const virtualModContents = fsMod
.readFileSync(contentPaths.virtualModTemplate, 'utf-8')
.replace('@@CONTENT_DIR@@', relContentDir)
Expand Down

0 comments on commit b2ea6c2

Please sign in to comment.