Skip to content

Commit

Permalink
fix: avoid tsconfig include .vue files outside rootDir with typescr…
Browse files Browse the repository at this point in the history
…ipt plugin

close #1276
  • Loading branch information
johnsoncodehk committed May 11, 2022
1 parent a10a6ab commit 16655cf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/typescript-vue-plugin/src/index.ts
Expand Up @@ -209,8 +209,10 @@ function createProxyHost(ts: typeof import('typescript/lib/tsserverlibrary'), in
fileExists: fileName => info.project.fileExists(fileName),
readFile: fileName => info.project.readFile(fileName),
};

const { fileNames } = ts.parseJsonConfigFileContent({}, parseConfigHost, info.project.getCurrentDirectory(), info.project.getCompilerOptions());
// fix https://github.com/johnsoncodehk/volar/issues/1276
// Should use raw tsconfig json not rootDir but seems cannot get it from plugin info
const includeRoot = path.resolve(info.project.getCurrentDirectory(), info.project.getCompilerOptions().rootDir || '.');
const { fileNames } = ts.parseJsonConfigFileContent({}, parseConfigHost, includeRoot, info.project.getCompilerOptions());
return fileNames;
}
function update() {
Expand Down

0 comments on commit 16655cf

Please sign in to comment.