mirror of
https://github.com/withastro/astro.git
synced 2025-01-13 22:11:20 -05:00
More fixes for tinyglobby
This commit is contained in:
parent
ff3e959a2f
commit
325ceacdae
1 changed files with 7 additions and 1 deletions
|
@ -38,6 +38,7 @@ export default async function build(...args) {
|
||||||
const prebuilds = getPrebuilds(isDev, args);
|
const prebuilds = getPrebuilds(isDev, args);
|
||||||
const patterns = args
|
const patterns = args
|
||||||
.filter((f) => !!f) // remove empty 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
|
.map((f) => f.replace(/^'/, '').replace(/'$/, '')); // Needed for Windows: glob strings contain surrounding string chars??? remove these
|
||||||
let entryPoints = [].concat(
|
let entryPoints = [].concat(
|
||||||
...(await Promise.all(
|
...(await Promise.all(
|
||||||
|
@ -118,7 +119,12 @@ export default async function build(...args) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function clean(outdir) {
|
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 })));
|
await Promise.all(files.map((file) => fs.rm(file, { force: true })));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue