0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-30 22:03:56 -05:00

More fixes for tinyglobby

This commit is contained in:
bluwy 2024-11-13 15:52:33 +08:00
parent ff3e959a2f
commit 325ceacdae

View file

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