work on splitting up extras css; start handling build metadata; start building sitemaps

This commit is contained in:
2023-05-19 00:00:15 -07:00
parent bf390c324f
commit 5689c64c4e
21 changed files with 1015 additions and 495 deletions

32
src/build-files/raw.ts Normal file
View File

@@ -0,0 +1,32 @@
import { glob } from 'glob';
import { BuildState } from './state';
import { promises as fs } from 'fs';
import { map_input_file_to_output_file } from './helpers';
export async function copy_raw_files(state: BuildState) {
const promises: Promise<any>[] = [ ];
const files = await glob(state.conf.input.raw, {
absolute: true,
cwd: state.conf.input.root,
});
for (const in_file of files) {
if (state.seen_files.has(in_file)) {
continue;
}
state.seen_files.add(in_file);
const out_file = map_input_file_to_output_file(state, in_file);
// todo: check hashes to see if we can skip
promises.push(
fs.copyFile(in_file, await out_file)
);
}
await Promise.all(promises);
// todo: update metadata
}