// 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"); }