Skip to content

Commit

Permalink
Use a port other than 8000 for npm serve.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
whitequark committed Jun 6, 2024
1 parent 636c2e4 commit ec716b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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]`);
}

0 comments on commit ec716b3

Please sign in to comment.