hot-reload: hide browserify's stack, enhance formatting
This commit is contained in:
parent
9ee6292565
commit
274a035ea9
2 changed files with 26 additions and 4 deletions
|
|
@ -88,11 +88,18 @@ function bundle() {
|
|||
output.on('error', (err)=> {
|
||||
|
||||
console.error(err.stack)
|
||||
send('errorPopup', convert.toHtml(
|
||||
'<div style="white-space:pre">' +
|
||||
err.stack.replace(new RegExp(path.resolve(__dirname + '/..'), 'g'),'.').trim().replace('\n','\n\n') +
|
||||
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>'
|
||||
))
|
||||
|
||||
)
|
||||
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -572,6 +572,21 @@ body {
|
|||
}
|
||||
}
|
||||
|
||||
.error-stack {
|
||||
padding:10rem;
|
||||
user-select:initial;
|
||||
cursor: initial;
|
||||
* {
|
||||
user-select:initial;
|
||||
cursor: initial;
|
||||
}
|
||||
overflow:auto;
|
||||
background: var(--color-bg);
|
||||
white-space:pre;
|
||||
font-family: monospace;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
.translation-missing {
|
||||
color: #ff00ff;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue