@jsenv/core 23.8.18 → 23.8.19
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
CHANGED
|
@@ -279,7 +279,7 @@ export const startCompileServer = async ({
|
|
|
279
279
|
jsenvDirectoryClean,
|
|
280
280
|
compileServerMetaFileInfo,
|
|
281
281
|
})
|
|
282
|
-
writeFile(
|
|
282
|
+
await writeFile(
|
|
283
283
|
compileServerMetaFileInfo.url,
|
|
284
284
|
JSON.stringify(compileServerMetaFileInfo.data, null, " "),
|
|
285
285
|
)
|
|
@@ -470,10 +470,20 @@ const cleanOutDirectoryIfNeeded = async ({
|
|
|
470
470
|
let previousCompileServerMeta
|
|
471
471
|
try {
|
|
472
472
|
const source = await readFile(compileServerMetaFileInfo.url)
|
|
473
|
-
|
|
473
|
+
if (source === "") {
|
|
474
|
+
previousCompileServerMeta = null
|
|
475
|
+
logger.debug(
|
|
476
|
+
`compiler server meta file is empty ${compileServerMetaFileInfo.url}`,
|
|
477
|
+
)
|
|
478
|
+
} else {
|
|
479
|
+
previousCompileServerMeta = JSON.parse(source)
|
|
480
|
+
}
|
|
474
481
|
} catch (e) {
|
|
475
482
|
if (e.code === "ENOENT") {
|
|
476
483
|
previousCompileServerMeta = null
|
|
484
|
+
} else if (e.name === "SyntaxError") {
|
|
485
|
+
previousCompileServerMeta = null
|
|
486
|
+
logger.warn(`Syntax error while parsing ${compileServerMetaFileInfo.url}`)
|
|
477
487
|
} else {
|
|
478
488
|
throw e
|
|
479
489
|
}
|