0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00
astro/.changeset/long-months-rule.md
Matthew Phillips 7315050fc1
Deprecate Astro.glob (#11826)
This deprecated Astro.glob, see the changeset for details.
2024-08-27 10:51:15 -04:00

753 B

astro
major

Deprecate Astro.glob

The Astro.glob function has been deprecated in favor of Content Collections and import.meta.glob.

Also consider using glob packages from npm, like fast-glob, especially if statically generating your site, as it is faster for most use-cases.

The easiest path is to migrate to import.meta.glob like so:

- const posts = Astro.glob('./posts/*.md');
+ const posts = Object.values(import.meta.glob('./posts/*.md', { eager: true }));