comparison 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
comparison
equal deleted inserted replaced
31:cfd1b1b6768a 32:141f0a7d1986
10 `; 10 `;
11 11
12 const prod = (process.argv[2] === 'production'); 12 const prod = (process.argv[2] === 'production');
13 13
14 var outdir = (process.argv[2] === 'dogfood' ? process.argv[3] : ''); 14 var outdir = (process.argv[2] === 'dogfood' ? process.argv[3] : '');
15 if (outdir != '') { 15 if (outdir != undefined && outdir != '') {
16 if (outdir.slice(-1) != '/' && outdir.slice(-1) != "\\") { 16 if (outdir.slice(-1) != '/' && outdir.slice(-1) != "\\") {
17 outdir += '/'; 17 outdir += '/';
18 } 18 }
19 } else {
20 throw("Please provide an output directory to put the dog food into");
19 } 21 }
20 22
21 const outfile = outdir + 'main.js'; 23 const outfile = outdir + 'main.js';
22 24
23 esbuild.build({ 25 esbuild.build({