From 7ff6714ff888a93fb92e469f64eb9f5ed783befb Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 5 Sep 2023 16:19:15 +0200 Subject: [PATCH] Use esbuild js --- packages/backend-core/scripts/build.js | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/packages/backend-core/scripts/build.js b/packages/backend-core/scripts/build.js index dd1992855a..ff8211b04a 100644 --- a/packages/backend-core/scripts/build.js +++ b/packages/backend-core/scripts/build.js @@ -1,19 +1,18 @@ #!/usr/bin/node const coreBuild = require("../../../scripts/build") -const { exec } = require("child_process") coreBuild("./src/plugin/index.ts", "./dist/plugins.js") coreBuild("./src/index.ts", "./dist/index.js") -const child = exec( - `esbuild ./tests/*.[tj]s ./tests/**/*.[tj]s --outdir=./dist/tests` -) -child.stdout.on("data", data => { - console.log(`stdout: ${data}`) -}) -child.stderr.on("data", data => { - console.error(`stderr: ${data}`) -}) -child.on("close", code => { - console.log(`esbuild process exited with code ${code}`) -}) +const esbuild = require("esbuild") +const glob = require("glob") + +const inputFiles = glob.sync("./tests/**/*.[tj]s", { nodir: true }) +const outputDir = "./dist/tests" + +esbuild + .build({ + entryPoints: inputFiles, + outdir: outputDir, + }) + .catch(() => process.exit(1))