Skip to content

Commit

Permalink
Merge pull request #121 from koliveira15/bugfix/vite-cjs-config
Browse files Browse the repository at this point in the history
bugfix: account for all vite config extensions
  • Loading branch information
koliveira15 authored Nov 14, 2024
2 parents 908a88f + 3157061 commit 4903a74
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions packages/nx-sonarqube/src/executors/scan/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,17 +164,27 @@ export async function determinePaths(
);
}
} else if (TestRunner.Vitest) {
const viteConfigPath: string = joinPathFragments(
context.root,
dep.projectRoot,
'vite.config.ts'
const viteConfigExtensions = ['.ts', '.js', '.mts', '.mjs'];
const viteConfigPaths = viteConfigExtensions.map((ext) =>
joinPathFragments(
context.root,
dep.projectRoot,
`vite.config${ext}`
)
);

if (!existsSync(viteConfigPath)) {
const viteConfigPath = viteConfigPaths.find((path) =>
existsSync(path)
);

if (!viteConfigPath) {
logger.warn(
`Skipping ${dep.name} as the vite config file cannot be found`
`Skipping ${
dep.name
} as no vite config file can be found. Checked extensions: ${viteConfigExtensions.join(
', '
)}`
);

return;
}

Expand Down

0 comments on commit 4903a74

Please sign in to comment.