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: support compileDependencies in speedup mode #6925

Merged
merged 1 commit into from
Aug 15, 2024

Conversation

ClarkXia
Copy link
Collaborator

Fix: #6917

Base automatically changed from release/next to master June 26, 2024 05:35
@ClarkXia ClarkXia changed the base branch from master to release/next June 26, 2024 06:02
@ClarkXia ClarkXia requested a review from linbudu599 July 8, 2024 06:54
Base automatically changed from release/next to master July 25, 2024 02:42
@ClarkXia ClarkXia changed the base branch from master to release/next July 25, 2024 05:41
flattenIncludes.push(pkg);
} else {
// The RegExp type of pkg may include multiple source paths.
flattenIncludes.push(...pkg.source.split('|'));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果是 \| 该如何应对?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pkg 的原始数据是多个 npm 包 join 在一起的,不会存在这种场景,并且 speedup 模式不支持配置正则,参考

if (speedupMode) {
throw new Error('speedup mode does not support config compileDependencies as RegExp');
}
return dep.source;
} else if (typeof dep === 'string') {
// add default prefix of node_modules
const matchStr = speedupMode ? dep : `node_modules/?.+${dep}/`;
return matchStr;
}
return false;
})
.filter(Boolean)
.join('|'),

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@ClarkXia ClarkXia mentioned this pull request Aug 15, 2024
3 tasks
@ClarkXia ClarkXia merged commit 47a5773 into release/next Aug 15, 2024
7 checks passed
@ClarkXia ClarkXia deleted the fix/compile-dependency branch August 15, 2024 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants