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 #!/usr/bin/node
const coreBuild = require("../../../scripts/build") const coreBuild = require("../../../scripts/build")
const { exec } = require("child_process")
coreBuild("./src/plugin/index.ts", "./dist/plugins.js") coreBuild("./src/plugin/index.ts", "./dist/plugins.js")
coreBuild("./src/index.ts", "./dist/index.js") coreBuild("./src/index.ts", "./dist/index.js")
const child = exec( const esbuild = require("esbuild")
`esbuild ./tests/*.[tj]s ./tests/**/*.[tj]s --outdir=./dist/tests` const glob = require("glob")
)
child.stdout.on("data", data => { const inputFiles = glob.sync("./tests/**/*.[tj]s", { nodir: true })
console.log(`stdout: ${data}`) const outputDir = "./dist/tests"
})
child.stderr.on("data", data => { esbuild
console.error(`stderr: ${data}`) .build({
}) entryPoints: inputFiles,
child.on("close", code => { outdir: outputDir,
console.log(`esbuild process exited with code ${code}`) })
}) .catch(() => process.exit(1))