Skip to content

Commit

Permalink
fix: update Vite links to use their new domain
Browse files Browse the repository at this point in the history
  • Loading branch information
ArmandPhilippot committed Oct 3, 2024
1 parent 6e32f93 commit 2a6ce93
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/content/docs/en/guides/imports.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ These aliases are also integrated automatically into [VS Code](https://code.visu

## `import.meta.glob()`

[Vite's `import.meta.glob()`](https://vitejs.dev/guide/features.html#glob-import) is a way to import many files at once using glob patterns to find matching file paths.
[Vite's `import.meta.glob()`](https://vite.dev/guide/features.html#glob-import) is a way to import many files at once using glob patterns to find matching file paths.

`import.meta.glob()` takes a relative [glob pattern](/en/guides/imports/#glob-patterns) matching the local files you'd like to import as a parameter. It returns an array of each matching file's exports. To load all matched modules up front, pass `{ eager: true }` as the second argument:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ const randomUser = data.results[0];
---
```

See more about [local files imports with `import.meta.glob()`](https://vitejs.dev/guide/features.html#glob-import), [querying using the Collections API](/en/guides/content-collections/#querying-collections) or [fetching remote data](/en/guides/data-fetching/).
See more about [local files imports with `import.meta.glob()`](https://vite.dev/guide/features.html#glob-import), [querying using the Collections API](/en/guides/content-collections/#querying-collections) or [fetching remote data](/en/guides/data-fetching/).

### Next Styling to Astro

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/guides/upgrade-to/v5.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ Placeholder
#### What should I do?
If you are using Vite-specific plugins, configuration, or APIs, check the [Vite migration guide](https://vitejs.dev/guide/migration) for their breaking changes and upgrade your project as needed. There are no breaking changes to Astro itself.
If you are using Vite-specific plugins, configuration, or APIs, check the [Vite migration guide](https://vite.dev/guide/migration) for their breaking changes and upgrade your project as needed. There are no breaking changes to Astro itself.
*/}

Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/en/reference/api-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The `Astro` global is available in all contexts in `.astro` files. It has the fo
### `Astro.glob()`

:::caution[Deprecated in v5.0]
Use [Vite's `import.meta.glob`](https://vitejs.dev/guide/features.html#glob-import) to query project files.
Use [Vite's `import.meta.glob`](https://vite.dev/guide/features.html#glob-import) to query project files.

`Astro.glob('../pages/post/*.md')` can be replaced with:

Expand Down Expand Up @@ -43,7 +43,7 @@ const posts = await Astro.glob('../pages/post/*.md'); // returns an array of pos

`.glob()` only takes one parameter: a relative URL glob of which local files you'd like to import. It’s asynchronous, and returns an array of the exports from matching files.

`.glob()` can't take variables or strings that interpolate them, as they aren't statically analyzable. (See [the imports guide](/en/guides/imports/#supported-values) for a workaround.) This is because `Astro.glob()` is a wrapper of Vite's [`import.meta.glob()`](https://vitejs.dev/guide/features.html#glob-import).
`.glob()` can't take variables or strings that interpolate them, as they aren't statically analyzable. (See [the imports guide](/en/guides/imports/#supported-values) for a workaround.) This is because `Astro.glob()` is a wrapper of Vite's [`import.meta.glob()`](https://vite.dev/guide/features.html#glob-import).

:::note
You can also use `import.meta.glob()` itself in your Astro project. You may want to do this when:
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/reference/loader-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export function feedLoader({ url }): Loader {
**Type**: `FSWatcher`
</p>

When running in dev mode, this is a filesystem watcher that can be used to trigger updates. See [`ViteDevServer`](https://vitejs.dev/guide/api-javascript.html#vitedevserver) for more information.
When running in dev mode, this is a filesystem watcher that can be used to trigger updates. See [`ViteDevServer`](https://vite.dev/guide/api-javascript.html#vitedevserver) for more information.

```ts title="Extract from the file() loader" {8-13}
return {
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/ru/reference/api-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const posts = await Astro.glob('../pages/post/*.md'); // returns an array of pos

`.glob()` принимает только один параметр: относительный URL-шаблон локальных файлов, которые вы хотите импортировать. Она работает асинхронно и возвращает массив экспортов из соответствующих файлов.

`.glob()` не может принимать переменные или строки, которые интерполируют их, поскольку они не поддаются статическому анализу. (Обходной путь см. в [руководстве по устранению неполадок](/ru/guides/imports/#supported-values)). Это происходит потому, что `Astro.glob()` является оберткой Vite's [`import.meta.glob()`](https://vitejs.dev/guide/features.html#glob-import).
`.glob()` не может принимать переменные или строки, которые интерполируют их, поскольку они не поддаются статическому анализу. (Обходной путь см. в [руководстве по устранению неполадок](/ru/guides/imports/#supported-values)). Это происходит потому, что `Astro.glob()` является оберткой Vite's [`import.meta.glob()`](https://vite.dev/guide/features.html#glob-import).

:::note
Вы также можете использовать `import.meta.glob()` в вашем проекте Astro. Вы можете захотеть сделать это, когда:
Expand Down

0 comments on commit 2a6ce93

Please sign in to comment.