Update astro.ts to clarify configuration settings for base (#7392)

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
This commit is contained in:
r-southworth 2023-06-27 11:15:10 -04:00 committed by GitHub
parent f6feff7a29
commit b51d515d2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -547,9 +547,11 @@ export interface AstroUserConfig {
* *
* When using this option, all of your static asset imports and URLs should add the base as a prefix. You can access this value via `import.meta.env.BASE_URL`. * When using this option, all of your static asset imports and URLs should add the base as a prefix. You can access this value via `import.meta.env.BASE_URL`.
* *
* By default, the value of `import.meta.env.BASE_URL` includes a trailing slash. If you have the [`trailingSlash`](https://docs.astro.build/en/reference/configuration-reference/#trailingslash) option set to `'never'`, you will need to add it manually in your static asset imports and URLs.
*
* ```astro * ```astro
* <a href="/docs/about/">About</a> * <a href="/docs/about/">About</a>
* <img src=`${import.meta.env.BASE_URL}/image.png`> * <img src=`${import.meta.env.BASE_URL}image.png`>
* ``` * ```
*/ */
base?: string; base?: string;