rollup-plugin-cleandir
Version:
Rollup Plugin for empty output directories.
22 lines (21 loc) • 561 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.cleandir = cleandir;
const cleandir_1 = require("@mstssk/cleandir");
/**
* Clean output directory.
* @param dirs [Optional]
* @returns {Plugin} Rollup Plugin
*/
function cleandir(dirs, options) {
const hook = options?.hook ?? "buildStart";
const order = options?.order ?? "pre";
return {
name: "cleandir",
[hook]: {
order,
sequential: true,
handler: () => (0, cleandir_1.cleandir)(dirs),
},
};
}