parent
8e40b8599b
commit
830585e2ba
15 changed files with 5371 additions and 15 deletions
18
scripts/copy-static-assets.mjs
Normal file
18
scripts/copy-static-assets.mjs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
|
||||
const repoRoot = process.cwd();
|
||||
const distRoot = path.join(repoRoot, "dist");
|
||||
const staticDirs = ["assets", "css", "js"];
|
||||
|
||||
function copyDir(source, destination) {
|
||||
fs.rmSync(destination, { recursive: true, force: true });
|
||||
fs.mkdirSync(path.dirname(destination), { recursive: true });
|
||||
fs.cpSync(source, destination, { recursive: true });
|
||||
}
|
||||
|
||||
for (const dir of staticDirs) {
|
||||
copyDir(path.join(repoRoot, dir), path.join(distRoot, dir));
|
||||
}
|
||||
|
||||
console.log(`Copied ${staticDirs.join(", ")} into dist/.`);
|
||||
Loading…
Add table
Add a link
Reference in a new issue