From 489f7bf284c80415573667903bc5729cd88ab644 Mon Sep 17 00:00:00 2001 From: Amsyar Rasyiq <82711525+amsyarasyiq@users.noreply.github.com> Date: Mon, 13 Feb 2023 22:57:32 +0800 Subject: [PATCH] Main: Update build.mjs --- build.mjs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build.mjs b/build.mjs index 6f835e9..ccb53e8 100644 --- a/build.mjs +++ b/build.mjs @@ -79,7 +79,12 @@ async function buildPlugin(plugin) { return await rollup(options).then(async (bundle) => { await bundle.write(options.output); await bundle.close(); - + + const toHash = readFileSync(outPath); + manifest.hash = createHash("sha256").update(toHash).digest("hex"); + manifest.main = "index.js"; + writeFileSync(`./dist/${plugin}/manifest.json`, JSON.stringify(manifest)); + console.log(`${plugin}: ` + "\x1b[32m" + "Build succeed!" + "\x1b[0m"); }); }