bimba-cli 0.4.4 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/serve.js +5 -2
package/package.json
CHANGED
package/serve.js
CHANGED
|
@@ -206,7 +206,7 @@ export function serve(entrypoint, flags) {
|
|
|
206
206
|
if (errors?.length) {
|
|
207
207
|
process.stdout.write(` ${theme.folder(now)} ${theme.filename(file)} ${status}\n`)
|
|
208
208
|
for (const err of errors) {
|
|
209
|
-
printerr(err)
|
|
209
|
+
try { printerr(err) } catch(_) { process.stdout.write(' ' + err.message + '\n') }
|
|
210
210
|
}
|
|
211
211
|
} else {
|
|
212
212
|
const myId = ++_fadeId
|
|
@@ -277,7 +277,10 @@ export function serve(entrypoint, flags) {
|
|
|
277
277
|
}
|
|
278
278
|
return new Response(out.js, { headers: { 'Content-Type': 'application/javascript' } })
|
|
279
279
|
} catch (e) {
|
|
280
|
-
|
|
280
|
+
const file = pathname.replace(/^\//, '')
|
|
281
|
+
printStatus(file, 'fail', [{ message: e.message }])
|
|
282
|
+
const payload = JSON.stringify({ type: 'error', file, errors: [{ message: e.message }] })
|
|
283
|
+
for (const socket of sockets) socket.send(payload)
|
|
281
284
|
return new Response(e.message, { status: 500 })
|
|
282
285
|
}
|
|
283
286
|
}
|