|
8 | 8 | import fs from "node:fs"; |
9 | 9 | import path from "node:path"; |
10 | 10 | import chalk from "chalk"; |
11 | | -import { Command } from "commander"; |
| 11 | +import { Command, Option } from "commander"; |
12 | 12 | import dotenv from "dotenv"; |
13 | 13 | // @ts-ignore FIXME: remove the ignore when/if https://github.com/antitoxic/import-single-ts/pull/7 is merged |
14 | 14 | import { importSingleTs } from "import-single-ts"; |
@@ -46,7 +46,11 @@ const commandWithOptions = (name: string) => |
46 | 46 | .option("-m, --minify", "minify bundle code") |
47 | 47 | .option("-s, --skip-simulator-package", "skips writing simulator package templates") |
48 | 48 | .option("-t, --output-metafile", "output `build_meta.json` file to bundles directory") |
49 | | - .option("-u, --output-sourcemaps", "append sourcemaps to the end of bundle files") |
| 49 | + .addOption( |
| 50 | + new Option("-p, --sourcemaps [type]", "generate sourcemaps") |
| 51 | + .choices(["linked", "external", "inline", "both"]) |
| 52 | + .preset("inline"), |
| 53 | + ) |
50 | 54 | .option("-v, --verbose", "output additional build information") |
51 | 55 | .hook("preAction", async (_thisCommand, actionCommand) => { |
52 | 56 | signale.info(`Welcome to ${chalk.cyanBright("Mach")}, v${version}`); |
|
0 commit comments