Skip to content

Commit

Permalink
chore(core): disable js code analysis when typescript is not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenPandaz committed Feb 24, 2023
1 parent e54ee0a commit 341a701
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,17 @@ export function buildExplicitTypescriptAndPackageJsonDependencies(
filesToProcess: ProjectFileMap
) {
let res: ExplicitDependency[] = [];

let typescriptExists = false;

try {
require.resolve('typescript');
typescriptExists = true;
} catch {}
if (
jsPluginConfig.analyzeSourceFiles === undefined ||
jsPluginConfig.analyzeSourceFiles === true
typescriptExists &&
(jsPluginConfig.analyzeSourceFiles === undefined ||
jsPluginConfig.analyzeSourceFiles === true)
) {
res = res.concat(
buildExplicitTypeScriptDependencies(projectGraph, filesToProcess)
Expand Down

0 comments on commit 341a701

Please sign in to comment.