Skip to content

Commit

Permalink
feat(plugin-composer): 优化模块集成脚本变化判断逻辑,避免错误判断导致脚本重复执行
Browse files Browse the repository at this point in the history
  • Loading branch information
lyfeyaj committed Mar 31, 2023
1 parent c62342c commit b4c08fd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/plugin-composer/src/compose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,11 @@ function savePreviousScripts(m: ComposeModuleInfo, type: ScriptsType) {
// 判断脚本是否发生变化
// 脚本顺序变化也代表需要重新执行
function isScriptsChanged(m: ComposeModuleInfo, type: ScriptsType): boolean {
const previous = PREVIOUS_SCRIPTS.get(`${m.name}-${m.hash}-${type}`) || {}
const previous = PREVIOUS_SCRIPTS.get(`${m.name}-${m.hash}-${type}`) || {
scripts: [],
options: {},
env: {}
}
const current = {
scripts: m.scripts?.[type] || [],
options: m.scripts?.options || {},
Expand Down

0 comments on commit b4c08fd

Please sign in to comment.