Skip to content

Commit b51b855

Browse files
MYCOINrschristian
andauthored
feat: [auto-commit] fix: _sizeInfo npe (#935)
* feat: [auto-commit] fix: _sizeInfo npe * docs: Adding changeset Co-authored-by: Ryan Christian <[email protected]>
1 parent fb0a437 commit b51b855

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

.changeset/clean-shoes-applaud.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'microbundle': patch
3+
---
4+
5+
Don't attempt to write build stats in watch mode when there has been a build error/sizeInfo is `undefined`

src/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,11 @@ function doWatch(options, cwd, steps) {
177177
}
178178
}
179179
if (e.code === 'END') {
180-
options._sizeInfo.then(text => {
181-
stdout(`Wrote ${text.trim()}`);
182-
});
180+
if (options._sizeInfo) {
181+
options._sizeInfo.then(text => {
182+
stdout(`Wrote ${text.trim()}`);
183+
});
184+
}
183185
if (typeof onBuild === 'function') {
184186
onBuild(e);
185187
}

0 commit comments

Comments
 (0)