0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00
astro/.changeset/nervous-waves-shop.md
Chris Swithinbank 61f47a6842
Support passing inline Astro config to getViteConfig() (#10963)
* Support passing inline Astro config to `getViteConfig()`

* Add changeset
2024-05-08 11:19:54 +01:00

22 lines
664 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
"astro": minor
---
Adds support for passing an inline Astro configuration object to `getViteConfig()`
If you are using `getViteConfig()` to configure the Vitest test runner, you can now pass a second argument to control how Astro is configured. This makes it possible to configure unit tests with different Astro options when using [Vitests workspaces](https://vitest.dev/guide/workspace.html) feature.
```js
// vitest.config.ts
import { getViteConfig } from 'astro/config';
export default getViteConfig(
/* Vite configuration */
{ test: {} },
/* Astro configuration */
{
site: 'https://example.com',
trailingSlash: 'never',
},
);
```