2023-05-23 18:53:53 +00:00
|
|
|
import { compileManifests } from "../plugos/compile.ts";
|
|
|
|
import { esbuild } from "../plugos/deps.ts";
|
2022-10-24 14:06:36 +00:00
|
|
|
|
2022-11-01 14:00:37 +00:00
|
|
|
export async function plugCompileCommand(
|
2023-05-23 18:53:53 +00:00
|
|
|
{ watch, dist, debug, info, importmap, runtimeUrl }: {
|
2022-10-24 14:06:36 +00:00
|
|
|
watch: boolean;
|
|
|
|
dist: string;
|
|
|
|
debug: boolean;
|
|
|
|
info: boolean;
|
|
|
|
importmap?: string;
|
2023-05-23 18:53:53 +00:00
|
|
|
runtimeUrl?: string;
|
2022-10-24 14:06:36 +00:00
|
|
|
},
|
|
|
|
...manifestPaths: string[]
|
|
|
|
) {
|
2023-05-23 18:53:53 +00:00
|
|
|
await compileManifests(
|
2022-10-24 14:06:36 +00:00
|
|
|
manifestPaths,
|
|
|
|
dist,
|
|
|
|
watch,
|
|
|
|
{
|
|
|
|
debug: debug,
|
|
|
|
info: info,
|
2023-05-23 18:53:53 +00:00
|
|
|
runtimeUrl,
|
2022-10-24 14:06:36 +00:00
|
|
|
importMap: importmap
|
2023-05-23 18:53:53 +00:00
|
|
|
? new URL(importmap, `file://${Deno.cwd()}/`).toString()
|
2022-10-24 14:06:36 +00:00
|
|
|
: undefined,
|
|
|
|
},
|
|
|
|
);
|
|
|
|
esbuild.stop();
|
2023-08-11 18:37:13 +00:00
|
|
|
Deno.exit(0);
|
2022-10-24 14:06:36 +00:00
|
|
|
}
|