Skip to content

Commit

Permalink
Fix vue-tsc and incremental cache (#3218)
Browse files Browse the repository at this point in the history
Co-authored-by: Johnson Chu <johnsoncodehk@gmail.com>
  • Loading branch information
lucasavila00 and johnsoncodehk authored Jun 7, 2023
1 parent ca60942 commit 0435d1a
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions packages/vue-tsc/bin/vue-tsc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,21 @@ fs.readFileSync = (...args) => {

// patches logic for checking root file extension in build program for incremental builds
if (semver.gt(tsPkg.version, '5.0.0')) {
tryReplace(`for (const existingRoot of buildInfoVersionMap.roots) {`, `for (const existingRoot of buildInfoVersionMap.roots
.filter(file => !file.toLowerCase().includes('__vls_'))
.map(file => file.replace(/\.vue\.(j|t)sx?$/i, '.vue'))
) {`);
tryReplace(
`for (const existingRoot of buildInfoVersionMap.roots) {`,
`for (const existingRoot of buildInfoVersionMap.roots
.filter(file => !file.toLowerCase().includes('__vls_'))
.map(file => file.replace(/\.vue\.(j|t)sx?$/i, '.vue'))
) {`
);
}
if (semver.gte(tsPkg.version, '5.0.4')) {
tryReplace(
`return createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, host);`,
s => `buildInfo.program.fileNames = buildInfo.program.fileNames
.filter(file => !file.toLowerCase().includes('__vls_'))
.map(file => file.replace(/\.vue\.(j|t)sx?$/i, '.vue'));\n` + s
);
}

return tsc;
Expand Down

0 comments on commit 0435d1a

Please sign in to comment.