fix: glob for single content extension
This commit is contained in:
parent
c8b78f0008
commit
7cf156b79b
1 changed files with 6 additions and 1 deletions
|
@ -24,7 +24,12 @@ export function astroContentVirtualModPlugin({
|
||||||
);
|
);
|
||||||
const contentEntryExts = getContentEntryExts(settings);
|
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
|
const virtualModContents = fsMod
|
||||||
.readFileSync(contentPaths.virtualModTemplate, 'utf-8')
|
.readFileSync(contentPaths.virtualModTemplate, 'utf-8')
|
||||||
.replace('@@CONTENT_DIR@@', relContentDir)
|
.replace('@@CONTENT_DIR@@', relContentDir)
|
||||||
|
|
Loading…
Reference in a new issue