forked from web-infra-dev/rspack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
x.mjs
executable file
·33 lines (25 loc) · 788 Bytes
/
x.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env zx
import "zx/globals";
import { Command } from "commander";
process.env.FORCE_COLOR = 3; // Fix zx losing color output in subprocesses
const program = new Command();
program
.name("Rspack Development CLI")
.description("CLI for development of Rspack")
.showHelpAfterError(true)
.showSuggestionAfterError(true);
// x install
program
.command("install")
.alias("i")
.description("install all dependencies")
.action(async function () {
await $`pnpm install`;
});
// x build
const buildCommand = program.command("build").alias("b").description("build");
// x build binding
buildCommand.command("binding").action(async function () {
await $`pnpm --filter @rspack/binding build:debug`;
});
program.parse(process.argv.slice(3), { from: "user" });