Skip to content

Commit

Permalink
fix(cli): while a module compiled fail, we also need to mark it.
Browse files Browse the repository at this point in the history
  • Loading branch information
Genuifx committed Aug 21, 2019
1 parent 58dbe78 commit 5de7216
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/wxa-cli/src/const/color.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ export default {
COMPILED: 1,
INIT: 0,
CHANGED: -1,
COMPILE_ERROR: -2,
};
4 changes: 2 additions & 2 deletions packages/wxa-cli/src/schedule.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ class Schedule {
return dep;
} catch (e) {
debug('编译失败 %O', e);
dep.color = COLOR.COMPILE_ERROR;
this.hooks.failedModule.call(dep, e);
throw e;
}
Expand Down Expand Up @@ -308,8 +309,7 @@ class Schedule {

// module changed: clean up mdl, mark module as changed.
if (
child.hash !== indexedModule.hash &&
indexedModule.color === COLOR.COMPILED
child.hash !== indexedModule.hash
) {
indexedModule.content = child.content;
indexedModule.hash = child.hash;
Expand Down

0 comments on commit 5de7216

Please sign in to comment.