hot-reload: when disabled, missing one condition to avoid extra error when build fails

This commit is contained in:
bordun 2018-10-26 11:37:27 +02:00
parent 7f76f8cab1
commit 92d0a06fbd

View file

@ -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>'
)
}
})