add warn message when using unsupported file types in pages/ (#6851)
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com> Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
This commit is contained in:
parent
c1669c0011
commit
e9fc2c2213
2 changed files with 12 additions and 0 deletions
5
.changeset/hip-bottles-hide.md
Normal file
5
.changeset/hip-bottles-hide.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Added warning message when using unsupported file extensions in pages/
|
|
@ -229,6 +229,8 @@ export function createRouteManifest(
|
|||
const localFs = fsMod ?? nodeFs;
|
||||
const isPrenderDefault = isHybridOutput(settings.config);
|
||||
|
||||
const foundInvalidFileExtensions: Set<string> = new Set();
|
||||
|
||||
function walk(
|
||||
fs: typeof nodeFs,
|
||||
dir: string,
|
||||
|
@ -252,6 +254,11 @@ export function createRouteManifest(
|
|||
}
|
||||
// filter out "foo.astro_tmp" files, etc
|
||||
if (!isDir && !validPageExtensions.has(ext) && !validEndpointExtensions.has(ext)) {
|
||||
if (!foundInvalidFileExtensions.has(ext)) {
|
||||
foundInvalidFileExtensions.add(ext);
|
||||
warn(logging, 'astro', `Invalid file extension for Pages: ${ext}`);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
const segment = isDir ? basename : name;
|
||||
|
|
Loading…
Reference in a new issue