import fs from "fs"; import path from "path"; import { fileURLToPath } from "url"; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); const src = path.resolve(__dirname, "widget/dist/cwd.js"); const destDir = path.resolve(__dirname, "public"); const dest = path.resolve(destDir, "cwd.js"); if (!fs.existsSync(destDir)) { fs.mkdirSync(destDir, { recursive: true }); } fs.copyFileSync(src, dest);