提交 9c2db291 编写于 作者: S Sasha Aickin 提交者: Arunoda Susiripala

Fixed an issue where two-page sites didn't split code. (#2329)

上级 8017bd37
......@@ -102,7 +102,12 @@ export default async function createCompiler (dir, { dev = false, quiet = false,
return module.context && module.context.indexOf('node_modules') >= 0
}
// Move modules used in at-least 1/2 of the total pages into commons.
// If there are one or two pages, only move modules to common if they are
// used in all of the pages. Otherwise, move modules used in at-least
// 1/2 of the total pages into commons.
if (totalPages <= 2) {
return count === totalPages
}
return count >= totalPages * 0.5
}
}),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册