File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ Workspace projects don't support all configuration properties. For better type s
9696
9797::: code-group
9898``` ts [packages/a/vitest.config.ts] twoslash
99+ // @errors: 2769
99100import { defineProject } from ' vitest/config'
100101
101102export default defineProject ({
Original file line number Diff line number Diff line change 11[build ]
22publish = " docs/.vitepress/dist"
33command = " pnpm ci:docs"
4- ignore = " git diff --quiet $COMMIT_REF $ CACHED_COMMIT_REF -- docs/ package.json pnpm-lock.yaml"
4+ ignore = " git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF docs/ package.json pnpm-lock.yaml"
55
66[build .environment ]
77NODE_VERSION = " 20"
Original file line number Diff line number Diff line change @@ -48,12 +48,22 @@ export function defineConfig(config: UserConfigExport): UserConfigExport {
4848 return config
4949}
5050
51- export function defineProject < T extends UserProjectConfigExport > ( config : T ) : T {
51+ export function defineProject ( config : UserWorkspaceConfig ) : UserWorkspaceConfig
52+ export function defineProject ( config : Promise < UserWorkspaceConfig > ) : Promise < UserWorkspaceConfig >
53+ export function defineProject ( config : UserProjectConfigFn ) : UserProjectConfigFn
54+ export function defineProject ( config : UserProjectConfigExport ) : UserProjectConfigExport
55+ export function defineProject ( config : UserProjectConfigExport ) : UserProjectConfigExport {
5256 return config
5357}
5458
55- type Workspace = string | ( UserProjectConfigExport & { extends ?: string } )
59+ type WorkspaceProjectConfiguration = string | ( UserProjectConfigExport & {
60+ /**
61+ * Relative path to the extendable config. All other options will be merged with this config.
62+ * @example '../vite.config.ts'
63+ */
64+ extends ?: string
65+ } )
5666
57- export function defineWorkspace ( config : Workspace [ ] ) : Workspace [ ] {
67+ export function defineWorkspace ( config : WorkspaceProjectConfiguration [ ] ) : WorkspaceProjectConfiguration [ ] {
5868 return config
5969}
You can’t perform that action at this time.
0 commit comments