Skip to content

Commit

Permalink
feat: [auto-commit] fix: _sizeInfo npe (#935)
Browse files Browse the repository at this point in the history
* feat: [auto-commit] fix: _sizeInfo npe

* docs: Adding changeset

Co-authored-by: Ryan Christian <[email protected]>
  • Loading branch information
MYCOIN and rschristian authored Apr 7, 2022
1 parent fb0a437 commit b51b855
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/clean-shoes-applaud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'microbundle': patch
---

Don't attempt to write build stats in watch mode when there has been a build error/sizeInfo is `undefined`
8 changes: 5 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,11 @@ function doWatch(options, cwd, steps) {
}
}
if (e.code === 'END') {
options._sizeInfo.then(text => {
stdout(`Wrote ${text.trim()}`);
});
if (options._sizeInfo) {
options._sizeInfo.then(text => {
stdout(`Wrote ${text.trim()}`);
});
}
if (typeof onBuild === 'function') {
onBuild(e);
}
Expand Down

0 comments on commit b51b855

Please sign in to comment.