Astro
astro.config
astro.config is the file, usually astro.config.mjs, where you set the output mode, adapter, integrations, site URL, and build options. Every Astro project has one.
How it is measured
Export a default defineConfig object. The fields that change behavior most are output, adapter, integrations, site, base, and image. Read the file top to bottom and you can predict what the build will emit.
Verify a setting by changing it and rebuilding. Change base from / to /docs and check that links and asset paths in dist/ all gain the prefix. Config errors usually surface as a failed build or a wrong URL.
Worked example
A cycling club puts its site in a subfolder of the club domain. The config has site set to the full URL and base set to /rides. Assets then load from /rides/_astro/, and the generated sitemap lists 33 URLs under that prefix.
Someone forgets to set site. The sitemap integration refuses to run, and canonical tags come out empty.
How it differs
astro.config holds project-wide settings. A .astro component holds one piece of a page. Config excludes markup and page logic; the component excludes anything that changes the build as a whole.
Common errors
Setting output to server without an adapter. Leaving site unset and breaking sitemaps and canonical tags. Putting secrets in the config file. Adding base and forgetting hard-coded absolute links. Editing the config without restarting the dev server.
In practice
Keep the file short and commented where a value is surprising. Set site on day one. When something behaves oddly, look at the config before the component.