Use esbuild js

This commit is contained in:
Adria Navarro 2023-09-05 16:19:15 +02:00
parent d3f4cde372
commit 7ff6714ff8
1 changed files with 12 additions and 13 deletions

View File

@ -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))