UNPKG

@nx/rollup

Version:

The Nx Plugin for Rollup contains executors and generators that support building applications using Rollup.

17 lines (16 loc) 627 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.deleteOutputDir = deleteOutputDir; const tslib_1 = require("tslib"); const path = tslib_1.__importStar(require("path")); const fs_1 = require("fs"); /** * Delete an output directory, but error out if it's the root of the project. */ function deleteOutputDir(root, outputPath) { const resolvedOutputPath = path.resolve(root, outputPath); if (resolvedOutputPath === root) { throw new Error('Output path MUST not be project root directory!'); } (0, fs_1.rmSync)(resolvedOutputPath, { recursive: true, force: true }); }