mirror of
https://github.com/withastro/astro.git
synced 2025-01-23 11:01:54 -05:00
[docs] Document base (#5693)
This commit is contained in:
parent
c0d3877d0d
commit
5df4a89a3a
1 changed files with 9 additions and 2 deletions
|
@ -424,15 +424,22 @@ export interface AstroUserConfig {
|
||||||
* @name base
|
* @name base
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @description
|
* @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
|
* ```js
|
||||||
* {
|
* {
|
||||||
* base: '/docs'
|
* 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;
|
base?: string;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue