提交 ea172958 编写于 作者: fxy060608's avatar fxy060608

fix(cli): Match the root path of the sub-package exactly #1440 #1504

上级 ed3a7b3a
......@@ -133,7 +133,7 @@ module.exports = function getSplitChunks () {
return chunks.find(item => !subPackageRoots.find(root => item.name.indexOf(root) === 0))
}
const subPackageRoots = Object.keys(process.UNI_SUBPACKAGES)
const subPackageRoots = Object.keys(process.UNI_SUBPACKAGES).map(root => root + '/')
Object.keys(process.UNI_SUBPACKAGES).forEach(root => {
(function (root) {
......@@ -145,7 +145,7 @@ module.exports = function getSplitChunks () {
const matchSubPackages = findSubPackages(chunks)
if (
matchSubPackages.size === 1 &&
matchSubPackages.has(root) &&
matchSubPackages.has(root + '/') &&
!hasMainPackage(chunks)
) {
if (process.env.UNI_OPT_TRACE) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册