diff options
author | 2023-07-10 20:39:32 +0800 | |
---|---|---|
committer | 2023-07-10 20:39:32 +0800 | |
commit | 904921cbe44e168477c751774a2e01a6cc972a16 (patch) | |
tree | f4d15a1b55f3f0f365bee9379f3b2bb23a84e15d | |
parent | 8df6a423c5088a68cc409b5415b09aff0c10a0f1 (diff) | |
download | astro-904921cbe44e168477c751774a2e01a6cc972a16.tar.gz astro-904921cbe44e168477c751774a2e01a6cc972a16.tar.zst astro-904921cbe44e168477c751774a2e01a6cc972a16.zip |
Ignore content .json files prefixed with underscores (#7611)
4 files changed, 7 insertions, 2 deletions
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 --- /dev/null +++ b/packages/astro/test/fixtures/content-collections/src/content/with-schema-config/_ignore.md 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 --- /dev/null +++ b/packages/astro/test/fixtures/content-collections/src/content/with-schema-config/_ignore/file.md |