dev playground: Start dev server even if first build is error + remove redundant error logs
This commit is contained in:
parent
d4f572a744
commit
87070bcdf3
1 changed files with 12 additions and 4 deletions
|
@ -54,10 +54,14 @@ const liveReload =
|
||||||
},
|
},
|
||||||
esbuildWatch: {
|
esbuildWatch: {
|
||||||
onRebuild(error) {
|
onRebuild(error) {
|
||||||
|
if (!error) {
|
||||||
|
console.error('Reloading...')
|
||||||
// Notify clients on rebuild
|
// Notify clients on rebuild
|
||||||
openResponses.forEach((res) => res.write('data: update\n\n'))
|
openResponses.forEach((res) => res.write('data: update\n\n'))
|
||||||
openResponses.length = 0
|
openResponses.length = 0
|
||||||
console.error(error ? error : 'Reloading...')
|
} else {
|
||||||
|
console.error('Rebuild had errors...')
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -141,6 +145,10 @@ const config: BuildOptions = {
|
||||||
|
|
||||||
esbuild
|
esbuild
|
||||||
.build(config)
|
.build(config)
|
||||||
|
.catch((err) => {
|
||||||
|
// if in dev mode, permit continuing to watch even if there was an error
|
||||||
|
return dev ? Promise.resolve() : Promise.reject(err)
|
||||||
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
// Read index.html template
|
// Read index.html template
|
||||||
const index = await readFile(path.join(__dirname, 'index.html'), 'utf8')
|
const index = await readFile(path.join(__dirname, 'index.html'), 'utf8')
|
||||||
|
|
Loading…
Reference in a new issue