UNPKG

kirbyup

Version:

Zero-config bundler for Kirby Panel plugins

21 lines (19 loc) 526 B
import * as fs from "node:fs"; import { resolve } from "pathe"; //#region src/node/plugins/build-cleanup.ts function kirbyupBuildCleanupPlugin(options) { let config; let devIndexPath; return { name: "kirbyup:build-cleanup", configResolved(resolvedConfig) { config = resolvedConfig; devIndexPath = resolve(config.root, options.outDir, "index.dev.mjs"); }, writeBundle() { if (fs.existsSync(devIndexPath)) fs.unlinkSync(devIndexPath); } }; } //#endregion export { kirbyupBuildCleanupPlugin as default };