mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
build(copy-dist): consolidate files and folder copying into one asset copying job
there's no benefit in having them split up like before
This commit is contained in:
parent
dbc2df0820
commit
9ac451e2b2
@ -29,32 +29,26 @@ const copy = async () => {
|
||||
fs.copySync(path.join("build", srcFile), destFile, { recursive: true });
|
||||
}
|
||||
|
||||
const filesToCopy = [
|
||||
"config-sample.ini",
|
||||
const assetsToCopy = new Set([
|
||||
"./images",
|
||||
"./libraries",
|
||||
"./translations",
|
||||
"./db",
|
||||
"./config-sample.ini",
|
||||
"./src/views/",
|
||||
"./src/etapi/etapi.openapi.yaml",
|
||||
"./src/routes/api/openapi.json",
|
||||
"./src/public/icon.png",
|
||||
"./src/public/manifest.webmanifest",
|
||||
"./src/public/robots.txt"
|
||||
];
|
||||
for (const file of filesToCopy) {
|
||||
log(`Copying ${file}`);
|
||||
await fs.copy(file, path.join(DEST_DIR, file));
|
||||
}
|
||||
"./src/public/robots.txt",
|
||||
"./src/public/fonts",
|
||||
"./src/public/stylesheets",
|
||||
"./src/public/translations"
|
||||
]);
|
||||
|
||||
const dirsToCopy = [
|
||||
"images",
|
||||
"libraries",
|
||||
"translations",
|
||||
"db",
|
||||
"src/public/fonts",
|
||||
"src/public/stylesheets",
|
||||
"src/public/translations",
|
||||
"src/views/"
|
||||
];
|
||||
for (const dir of dirsToCopy) {
|
||||
log(`Copying ${dir}`);
|
||||
await fs.copy(dir, path.join(DEST_DIR, dir));
|
||||
for (const asset of assetsToCopy) {
|
||||
log(`Copying ${asset}`);
|
||||
await fs.copy(asset, path.join(DEST_DIR, asset));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user