Exclude hidden assets from builds and record deployment checks
showcase/deploy Live at https://showcase.andrefiedler.de/2608_BuB/
showcase/deploy Live at https://showcase.andrefiedler.de/2608_BuB/
This commit is contained in:
+5
-1
@@ -1,5 +1,6 @@
|
||||
import { cp, mkdir, rm } from 'node:fs/promises';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { basename } from 'node:path';
|
||||
|
||||
const root = new URL('../', import.meta.url);
|
||||
const output = new URL('dist/', root);
|
||||
@@ -8,6 +9,9 @@ const publicFiles = ['index.html', 'assets', 'favicon.ico', 'favicon.svg', 'site
|
||||
await rm(output, { recursive: true, force: true });
|
||||
await mkdir(output, { recursive: true });
|
||||
for (const filename of publicFiles) {
|
||||
await cp(new URL(filename, root), new URL(filename, output), { recursive: true });
|
||||
await cp(new URL(filename, root), new URL(filename, output), {
|
||||
recursive: true,
|
||||
filter: (source) => !basename(source).startsWith('.'),
|
||||
});
|
||||
}
|
||||
console.log(`Static site built at ${fileURLToPath(output)}`);
|
||||
|
||||
Reference in New Issue
Block a user