Skip to content

docs(en): merge docs-cn/sync-docs into docs-cn/dev @ e906203e #644

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 14 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: use extends instead of configFile in injectTestProjects (…
…#7860)
  • Loading branch information
romhml authored May 5, 2025
commit a40aa270ad3cd61fb1e96ef429617b5bf222aa1a
6 changes: 3 additions & 3 deletions advanced/api/plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ This methods accepts a config glob pattern, a filepath to the config or an inlin
```ts
// inject a single project with a custom alias
const newProjects = await injectTestProjects({
// you can inherit the current project config by referencing `configFile`
// you can inherit the current project config by referencing `extends`
// note that you cannot have a project with the name that already exists,
// so it's a good practice to define a custom name
configFile: project.vite.config.configFile,
extends: project.vite.config.configFile,
test: {
name: 'my-custom-alias',
alias: {
Expand All @@ -117,7 +117,7 @@ Note that this will only affect projects injected with [`injectTestProjects`](#i
:::

::: tip Referencing the Current Config
If you want to keep the user configuration, you can specify the `configFile` property. All other properties will be merged with the user defined config.
If you want to keep the user configuration, you can specify the `extends` property. All other properties will be merged with the user defined config.

The project's `configFile` can be accessed in Vite's config: `project.vite.config.configFile`.

Expand Down