Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix vue-tsc and incremental cache #3218

Merged
merged 5 commits into from Jun 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 15 additions & 4 deletions packages/vue-tsc/bin/vue-tsc.js
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