silverbullet/cmd/plug_compile.ts

33 lines
693 B
TypeScript
Raw Normal View History

import { compileManifests } from "./compile.ts";
import * as esbuild from "esbuild";
2022-11-01 22:00:37 +08:00
export async function plugCompileCommand(
2024-07-30 20:04:43 +08:00
{ watch, dist, debug, info, importmap, config, runtimeUrl }: {
watch: boolean;
dist: string;
debug: boolean;
info: boolean;
importmap?: string;
2024-07-30 20:04:43 +08:00
config?: string;
runtimeUrl?: string;
},
...manifestPaths: string[]
) {
await compileManifests(
manifestPaths,
dist,
watch,
{
debug: debug,
info: info,
runtimeUrl,
importMap: importmap
? new URL(importmap, `file://${Deno.cwd()}/`).toString()
: undefined,
2024-07-30 20:04:43 +08:00
configPath: config,
},
);
esbuild.stop();
2023-08-12 02:37:13 +08:00
Deno.exit(0);
}