Skip to content

Commit 355dcb4

Browse files
committed
fix: resolve .extends correctly
1 parent bb6e13e commit 355dcb4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/vitest/src/node/workspace/resolveWorkspace.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,18 @@ export async function resolveWorkspace(
5656

5757
projectConfigs.forEach((options, index) => {
5858
const parentConfigPath = workspaceConfigPath || vitest.server.config.configFile
59+
const configDir = parentConfigPath ? dirname(parentConfigPath) : vitest.config.root
5960
// if extends a config file, resolve the file path
6061
const configFile = typeof options.extends === 'string' && typeof parentConfigPath === 'string'
61-
? resolve(parentConfigPath, options.extends)
62+
? resolve(configDir, options.extends)
6263
: false
6364
// if extends a root config, use the users root options
6465
const rootOptions = options.extends === true
6566
? vitest._options
6667
: {}
6768
// if `root` is configured, resolve it relative to the workespace file or vite root (like other options)
6869
// if `root` is not specified, inline configs use the same root as the root project
69-
const root = options.root
70-
? resolve(workspaceConfigPath || vitest.config.root)
71-
: vitest.config.root
70+
const root = options.root ? resolve(configDir) : vitest.config.root
7271
projectPromises.push(concurrent(() => initializeProject(
7372
index,
7473
vitest,

0 commit comments

Comments
 (0)