From e286008e080223c63b26971ceeec332d986abd51 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 16 Jun 2023 14:16:32 +0100 Subject: [PATCH] Generate metafile --- scripts/build.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/build.js b/scripts/build.js index 3d071508b0..e293bb0774 100755 --- a/scripts/build.js +++ b/scripts/build.js @@ -31,6 +31,7 @@ function runBuild(entry, outfile) { loader: { ".svelte": "copy", }, + metafile: true, packages: "external", external: [ "deasync", @@ -51,7 +52,7 @@ function runBuild(entry, outfile) { ...sharedConfig, platform: "node", outfile, - }).then(() => { + }).then(result => { glob(`${process.cwd()}/src/**/*.hbs`, {}, (err, files) => { for (const file of files) { fs.copyFileSync(file, `${process.cwd()}/dist/${path.basename(file)}`) @@ -62,6 +63,11 @@ function runBuild(entry, outfile) { `Build successfully in ${(Date.now() - start) / 1000} seconds` ) }) + + fs.writeFileSync( + `dist/${path.basename(outfile)}.meta.json`, + JSON.stringify(result.metafile) + ) }) }