Skip to content

Commit

Permalink
Clear the console in browser on each HMR (#1073)
Browse files Browse the repository at this point in the history
  • Loading branch information
ameerthehacker authored and devongovett committed Apr 28, 2018
1 parent 3fe54a6 commit 1a688cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/builtins/hmr-runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
hmrAccept(global.parcelRequire, asset.id);
}
});
// Clear the console after HMR
console.clear();
}

if (data.type === 'reload') {
Expand Down
6 changes: 4 additions & 2 deletions test/hmr.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,8 @@ describe('hmr', function() {
console: {
error(msg) {
logs.push(msg);
}
},
clear() {}
}
},
{require: false}
Expand Down Expand Up @@ -349,7 +350,8 @@ describe('hmr', function() {
},
log(msg) {
logs.push(msg);
}
},
clear() {}
}
},
{require: false}
Expand Down

0 comments on commit 1a688cd

Please sign in to comment.