From ec716b3d8500789c2fe64bf3924de3f6f9bb0b51 Mon Sep 17 00:00:00 2001 From: Catherine Date: Thu, 6 Jun 2024 04:17:30 +0100 Subject: [PATCH] Use a port other than 8000 for `npm serve`. If the port is already open by a different appliation, esbuild reports no error and does not switch to another port. Instead, the URL it prints displays an unrelated page. This change should reduce the likelihood of collision. --- build.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.mjs b/build.mjs index 74b17d7..4985575 100644 --- a/build.mjs +++ b/build.mjs @@ -53,7 +53,7 @@ if (mode === 'build' || mode === 'minify') { await context.rebuild(); await context.watch(); // Specifying `servedir` is necessary for files built by meta URL plugin to be accessible. - await context.serve({ servedir: 'dist' }); + await context.serve({ servedir: 'dist', port: 8010 }); } else { console.error(`Usage: ${process.argv0} [build|watch|serve|minify]`); }