1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
// Copies the Material icon SVGs from vscode-material-icons into public/, so
// Vite ships them as static assets. Runs automatically before `dev` and
// `build` (npm pre-hooks); the copy is skipped when already present.
import { cpSync, existsSync } from "node:fs";
import { fileURLToPath } from "node:url";
const source = fileURLToPath(
new URL(
"../node_modules/vscode-material-icons/generated/icons",
import.meta.url,
),
);
const destination = fileURLToPath(
new URL("../public/material-icons", import.meta.url),
);
if (!existsSync(destination)) {
cpSync(source, destination, { recursive: true });
console.log("material icons copied to public/material-icons");
}
|