1 | #!/usr/bin/env node
|
2 | import { build } from "./scripts/build.js";
|
3 | import arg from "arg";
|
4 | function getBuildArgs(argv) {
|
5 | return arg({
|
6 | "--debug-hydration": Boolean,
|
7 | "--no-clean": Boolean,
|
8 | "--filter": String,
|
9 | "-f": "--filter",
|
10 | }, { permissive: true, argv });
|
11 | }
|
12 | async function run() {
|
13 | let [command, ...argv] = process.argv.slice(2);
|
14 | if (argv[0] === "--")
|
15 | argv = argv.slice(1);
|
16 | if (command === "build") {
|
17 | const args = getBuildArgs(argv);
|
18 | await build(args);
|
19 | return;
|
20 | }
|
21 | }
|
22 | run();
|