summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.changeset/hip-bottles-hide.md5
-rw-r--r--packages/astro/src/core/routing/manifest/create.ts7
2 files changed, 12 insertions, 0 deletions
diff --git a/.changeset/hip-bottles-hide.md b/.changeset/hip-bottles-hide.md
new file mode 100644
index 000000000..d8564ab64
--- /dev/null
+++ b/.changeset/hip-bottles-hide.md
@@ -0,0 +1,5 @@
+---
+'astro': patch
+---
+
+Added warning message when using unsupported file extensions in pages/
diff --git a/packages/astro/src/core/routing/manifest/create.ts b/packages/astro/src/core/routing/manifest/create.ts
index 472822109..51f495e8b 100644
--- a/packages/astro/src/core/routing/manifest/create.ts
+++ b/packages/astro/src/core/routing/manifest/create.ts
@@ -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;