Skip to content

Commit

Permalink
fix(vite): nxViteTsPaths plugin should not run-many for vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
Coly010 committed Jun 17, 2024
1 parent f431d0a commit 7150e06
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/vite/plugins/nx-tsconfig-paths.plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ export function nxViteTsPaths(options: nxViteTsPathsOptions = {}) {
There should at least be a tsconfig.base.json or tsconfig.json in the root of the workspace ${workspaceRoot}`);
}

if (!options.buildLibsFromSource && !global.NX_GRAPH_CREATION) {
if (
!options.buildLibsFromSource &&
!global.NX_GRAPH_CREATION &&
config.mode !== 'test'
) {
const projectGraph = await createProjectGraphAsync({
exitOnError: false,
resetDaemonClient: true,
Expand Down Expand Up @@ -123,7 +127,7 @@ There should at least be a tsconfig.base.json or tsconfig.json in the root of th

logIt('first parsed tsconfig: ', parsed);
if (parsed.resultType === 'failed') {
throw new Error(`Failed loading tsonfig at ${foundTsConfigPath}`);
throw new Error(`Failed loading tsconfig at ${foundTsConfigPath}`);
}
tsConfigPathsEsm = parsed;

Expand Down

0 comments on commit 7150e06

Please sign in to comment.