From 325ceacdae77bc8446303000f579635309125ff9 Mon Sep 17 00:00:00 2001 From: bluwy Date: Wed, 13 Nov 2024 15:52:33 +0800 Subject: [PATCH] More fixes for tinyglobby --- scripts/cmd/build.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/cmd/build.js b/scripts/cmd/build.js index d86d974a3c..5d5ef19d3f 100644 --- a/scripts/cmd/build.js +++ b/scripts/cmd/build.js @@ -38,6 +38,7 @@ export default async function build(...args) { const prebuilds = getPrebuilds(isDev, args); const patterns = args .filter((f) => !!f) // remove empty args + .filter((f) => !f.startsWith('--')) // remove flags .map((f) => f.replace(/^'/, '').replace(/'$/, '')); // Needed for Windows: glob strings contain surrounding string chars??? remove these let entryPoints = [].concat( ...(await Promise.all( @@ -118,7 +119,12 @@ export default async function build(...args) { } async function clean(outdir) { - const files = await glob([`${outdir}/**`, `!${outdir}/**/*.d.ts`], { filesOnly: true }); + const files = await glob('**', { + cwd: outdir, + filesOnly: true, + ignore: ['**/*.d.ts'], + absolute: true, + }); await Promise.all(files.map((file) => fs.rm(file, { force: true }))); }