-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Conversation
flattenIncludes.push(pkg); | ||
} else { | ||
// The RegExp type of pkg may include multiple source paths. | ||
flattenIncludes.push(...pkg.source.split('|')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果是 \|
该如何应对?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkg 的原始数据是多个 npm 包 join 在一起的,不会存在这种场景,并且 speedup 模式不支持配置正则,参考
ice/packages/ice/src/config.ts
Lines 255 to 267 in 2928447
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('|'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
Fix: #6917