diff --git a/.changeset/funny-tomatoes-guess.md b/.changeset/funny-tomatoes-guess.md new file mode 100644 index 000000000..cd8b65b49 --- /dev/null +++ b/.changeset/funny-tomatoes-guess.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Ignore content .json files prefixed with underscores (regression) diff --git a/packages/astro/src/content/vite-plugin-content-virtual-mod.ts b/packages/astro/src/content/vite-plugin-content-virtual-mod.ts index 62ba612e9..021a26314 100644 --- a/packages/astro/src/content/vite-plugin-content-virtual-mod.ts +++ b/packages/astro/src/content/vite-plugin-content-virtual-mod.ts @@ -213,7 +213,7 @@ function globWithUnderscoresIgnored(relContentDir: string, exts: string[]): stri const contentDir = appendForwardSlash(relContentDir); return [ `${contentDir}**/*${extGlob}`, - `!${contentDir}_*/**${extGlob}`, - `!${contentDir}_*${extGlob}`, + `!${contentDir}**/_*/**${extGlob}`, + `!${contentDir}**/_*${extGlob}`, ]; } diff --git a/packages/astro/test/fixtures/content-collections/src/content/with-schema-config/_ignore.md b/packages/astro/test/fixtures/content-collections/src/content/with-schema-config/_ignore.md new file mode 100644 index 000000000..e69de29bb diff --git a/packages/astro/test/fixtures/content-collections/src/content/with-schema-config/_ignore/file.md b/packages/astro/test/fixtures/content-collections/src/content/with-schema-config/_ignore/file.md new file mode 100644 index 000000000..e69de29bb