diff options
author | 2023-05-17 16:02:33 +0200 | |
---|---|---|
committer | 2023-05-17 16:02:33 +0200 | |
commit | e9fc2c2213036d47cd30a47a6cdad5633481a0f8 (patch) | |
tree | fcf8d3926530f31d3bb337aa40c893421ff6df47 | |
parent | c1669c0011eecfe65a459d727848c18c189a54ca (diff) | |
download | astro-e9fc2c2213036d47cd30a47a6cdad5633481a0f8.tar.gz astro-e9fc2c2213036d47cd30a47a6cdad5633481a0f8.tar.zst astro-e9fc2c2213036d47cd30a47a6cdad5633481a0f8.zip |
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>
-rw-r--r-- | .changeset/hip-bottles-hide.md | 5 | ||||
-rw-r--r-- | packages/astro/src/core/routing/manifest/create.ts | 7 |
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; |