AstroUserConfig Type — astro Architecture
Architecture documentation for the AstroUserConfig type/interface in config.ts from the astro codebase.
Entity Profile
Dependency Diagram
graph TD 838ddd8b_c352_4d94_7635_21d627fcf340["AstroUserConfig"] 9a410621_7e4c_298f_fae4_ea2f60c8b25d["config.ts"] 838ddd8b_c352_4d94_7635_21d627fcf340 -->|defined in| 9a410621_7e4c_298f_fae4_ea2f60c8b25d style 838ddd8b_c352_4d94_7635_21d627fcf340 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/astro/src/types/public/config.ts lines 158–2767
export interface AstroUserConfig<
TLocales extends Locales = never,
TDriver extends SessionDriverName | SessionDriverConfig | undefined = never,
TFontProviders extends Array<FontProvider> = never,
> {
/**
* @docs
* @kind heading
* @name Top-Level Options
*/
/**
* @docs
* @name site
* @type {string}
* @description
* Your final, deployed URL. Astro uses this full URL to generate your sitemap and canonical URLs in your final build. It is strongly recommended that you set this configuration to get the most out of Astro.
*
* ```js
* {
* site: 'https://www.my-site.dev'
* }
* ```
*/
site?: string;
/**
* @docs
* @name base
* @type {string}
* @description
* 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.
*
* 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`.
*
* The value of `import.meta.env.BASE_URL` will be determined by your `trailingSlash` config, no matter what value you have set for `base`.
*
* A trailing slash is always included if `trailingSlash: "always"` is set. If `trailingSlash: "never"` is set, `BASE_URL` will not include a trailing slash, even if `base` includes one.
*
* Additionally, Astro will internally manipulate the configured value of `config.base` before making it available to integrations. The value of `config.base` as read by integrations will also be determined by your `trailingSlash` configuration in the same way.
*
* In the example below, the values of `import.meta.env.BASE_URL` and `config.base` when processed will both be `/docs`:
* ```js
* {
* base: '/docs/',
* trailingSlash: "never"
* }
* ```
*
* In the example below, the values of `import.meta.env.BASE_URL` and `config.base` when processed will both be `/docs/`:
*
* ```js
* {
* base: '/docs',
* trailingSlash: "always"
* }
* ```
*/
base?: string;
/**
* @docs
* @name trailingSlash
* @type {('always' | 'never' | 'ignore')}
* @default `'ignore'`
* @see build.format
* @description
*
* Set the route matching behavior for trailing slashes in the dev server and on-demand rendered pages. Choose from the following options:
* - `'ignore'` - Match URLs regardless of whether a trailing "/" exists. Requests for "/about" and "/about/" will both match the same route.
* - `'always'` - Only match URLs that include a trailing slash (e.g: "/about/"). In production, requests for on-demand rendered URLs without a trailing slash will be redirected to the correct URL for your convenience. However, in development, they will display a warning page reminding you that you have `always` configured.
* - `'never'` - Only match URLs that do not include a trailing slash (e.g: "/about"). In production, requests for on-demand rendered URLs with a trailing slash will be redirected to the correct URL for your convenience. However, in development, they will display a warning page reminding you that you have `never` configured.
*
Defined In
Source
Frequently Asked Questions
What is the AstroUserConfig type?
AstroUserConfig is a type/interface in the astro codebase, defined in packages/astro/src/types/public/config.ts.
Where is AstroUserConfig defined?
AstroUserConfig is defined in packages/astro/src/types/public/config.ts at line 158.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free