hot-reload: when disabled, missing one condition to avoid extra error when build fails
This commit is contained in:
parent
7f76f8cab1
commit
92d0a06fbd
1 changed files with 13 additions and 12 deletions
|
|
@ -88,18 +88,19 @@ function bundle() {
|
|||
output.on('error', (err)=> {
|
||||
|
||||
console.error(err.stack)
|
||||
send('errorPopup',
|
||||
'<div class="error-stack">' +
|
||||
convert.toHtml(
|
||||
err.stack
|
||||
.replace(/\n\s*at Parser.*/g, '') // remove useless stack
|
||||
.replace(new RegExp(path.resolve(__dirname + '/..'), 'g'),'.') // shorten file path
|
||||
.trim()
|
||||
.replace('\n','\n\n') // add 1 new line after 1st line
|
||||
) +
|
||||
'</div>'
|
||||
|
||||
)
|
||||
if (autoRefresh) {
|
||||
send('errorPopup',
|
||||
'<div class="error-stack">' +
|
||||
convert.toHtml(
|
||||
err.stack
|
||||
.replace(/\n\s*at Parser.*/g, '') // remove useless stack
|
||||
.replace(new RegExp(path.resolve(__dirname + '/..'), 'g'),'.') // shorten file path
|
||||
.trim()
|
||||
.replace('\n','\n\n') // add 1 new line after 1st line
|
||||
) +
|
||||
'</div>'
|
||||
)
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue