Skip to content

Commit

Permalink
Change from review
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic committed Aug 1, 2024
1 parent 8ea2b3b commit 71f1950
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/astro/src/content/vite-plugin-content-imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,12 @@ export const _internal = {
const entryType = getEntryType(entry, contentPaths, contentEntryExts, dataEntryExts);
if (!COLLECTION_TYPES_TO_INVALIDATE_ON.includes(entryType)) return;

// The content config could depend on collection entries via `reference()`.
// Reload the config in case of changes.
await reloadContentConfigObserver({ fs, settings, viteServer });
// Changes to the config file itself are handled in types-generator.ts, so we skip them here
if (entryType === 'content' || entryType === 'data') {
await reloadContentConfigObserver({ fs, settings, viteServer });
}

// Invalidate all content imports and `render()` modules.
// TODO: trace `reference()` calls for fine-grained invalidation.
Expand Down

0 comments on commit 71f1950

Please sign in to comment.