Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Document base #5693

Merged
merged 7 commits into from
Jan 4, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions packages/astro/src/@types/astro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,15 +444,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 you're deploying to. Astro will match this pathname during development so that your development experience matches your build environment as closely as possible. You can access this value in your app via `import.meta.env.BASE_URL`.
sarah11918 marked this conversation as resolved.
Show resolved Hide resolved
*
* 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.
sarah11918 marked this conversation as resolved.
Show resolved Hide resolved
*
* ```astro
* <a href="/docs/about/">About</a>
* <img src=`${import.meta.env.BASE_URL}/image.png`>
* ```
*/
base?: string;

Expand Down