diff esbuild.config.mjs @ 32:141f0a7d1986

Better error handling for npm dogfood command. Expand the README info.
author Ludovic Chabant <ludovic@chabant.com>
date Mon, 28 Nov 2022 20:39:13 -0800
parents 61fd7dde51d3
children 1c8e46c3e941
line wrap: on
line diff
--- a/esbuild.config.mjs	Thu Jul 14 14:47:04 2022 -0700
+++ b/esbuild.config.mjs	Mon Nov 28 20:39:13 2022 -0800
@@ -12,10 +12,12 @@
 const prod = (process.argv[2] === 'production');
 
 var outdir = (process.argv[2] === 'dogfood' ? process.argv[3] : '');
-if (outdir != '') {
+if (outdir != undefined && outdir != '') {
 	if (outdir.slice(-1) != '/' && outdir.slice(-1) != "\\") {
 		outdir += '/';
 	}
+} else {
+	throw("Please provide an output directory to put the dog food into");
 }
 
 const outfile = outdir + 'main.js';