Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support passing inline Astro config to getViteConfig() (#10963)
* Support passing inline Astro config to `getViteConfig()` * Add changeset
- Loading branch information
Showing
2 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
"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 [Vitest’s 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', | ||
}, | ||
); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters