import path from "path"; import fs from "fs"; import("./key.json", { assert: { type: "json" }, }).then((keyJsonSchema) => fs.writeFileSync( path.join(distPath, "/key.json"), JSON.stringify(keyJsonSchema) ) ); const distPath = path.join(__dirname, "../../dist"); if (!fs.existsSync(distPath)) { fs.mkdirSync(distPath); }