1
0
silverbullet/build_plugs.ts

32 lines
791 B
TypeScript
Raw Normal View History

import { esbuild, flags, path } from "./plugos/deps.ts";
import { compileManifests } from "./plugos/compile.ts";
import { builtinPlugNames } from "./plugs/builtin_plugs.ts";
2023-01-22 17:53:14 +00:00
if (import.meta.main) {
const args = flags.parse(Deno.args, {
boolean: ["debug", "watch", "reload", "info"],
alias: { w: "watch" },
});
const manifests = builtinPlugNames.map((name) =>
`./plugs/${name}/${name}.plug.yaml`
);
2023-01-22 17:53:14 +00:00
const targetDir = path.join("dist_plug_bundle", "_plug");
Deno.mkdirSync(targetDir, { recursive: true });
Deno.mkdirSync("dist", { recursive: true });
2023-01-22 17:53:14 +00:00
// Build the other plugs
await compileManifests(
2023-01-22 17:53:14 +00:00
manifests,
targetDir,
2023-01-22 17:53:14 +00:00
args.watch,
{
debug: args.debug,
reload: args.reload,
info: args.info,
},
);
esbuild.stop();
}