Skip to content

Commit

Permalink
[docs] Document base (#5693)
Browse files Browse the repository at this point in the history
  • Loading branch information
sarah11918 committed Jan 4, 2023
1 parent c0d3877 commit 5df4a89
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/astro/src/@types/astro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,15 +424,22 @@ export interface AstroUserConfig {
* @name base
* @type {string}
* @description
* The base path to deploy to. Astro will build your pages and assets using this path as the root. Currently, this has no effect during development.
* The base path to deploy to. Astro will use this path as the root for your pages and assets both in development and in production build.
*
* You can access this value in your app via `import.meta.env.BASE_URL`.
* In the example below, `astro dev` will start your server at `/docs`.
*
* ```js
* {
* base: '/docs'
* }
* ```
*
* 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`.
*
* ```astro
* <a href="/docs/about/">About</a>
* <img src=`${import.meta.env.BASE_URL}/image.png`>
* ```
*/
base?: string;

Expand Down

0 comments on commit 5df4a89

Please sign in to comment.