Error handling for transient sourcemap build failures
This commit is contained in:
parent
7dcbd2130d
commit
133acb3e77
1 changed files with 6 additions and 2 deletions
|
@ -108,13 +108,17 @@ async function rebuild() {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const root of SOURCE_ROOTS) {
|
for (const root of SOURCE_ROOTS) {
|
||||||
fs.watch(root, { recursive: true }, (_, file) => {
|
fs.watch(root, { recursive: true }, async (_, file) => {
|
||||||
if (file?.startsWith('.git/')) return
|
if (file?.startsWith('.git/')) return
|
||||||
console.log(
|
console.log(
|
||||||
`Detected change in ${root} -> ${file}; rebuilding sourcemap...`,
|
`Detected change in ${root} -> ${file}; rebuilding sourcemap...`,
|
||||||
)
|
)
|
||||||
sourcemapCache.delete(root)
|
sourcemapCache.delete(root)
|
||||||
rebuild()
|
try {
|
||||||
|
await rebuild()
|
||||||
|
} catch {
|
||||||
|
console.error('Failed to rebuild sourcemap.')
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue