Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(node): add deleteOutputPath option to @nrwl/node:webpack executor (
- Loading branch information
1 parent
7418ae1
commit 99b245b
Showing
7 changed files
with
97 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import * as path from 'path'; | ||
import { removeSync } from 'fs-extra'; | ||
|
||
/** | ||
* Delete an output directory, but error out if it's the root of the project. | ||
*/ | ||
export function deleteOutputDir(root: string, outputPath: string) { | ||
const resolvedOutputPath = path.resolve(root, outputPath); | ||
if (resolvedOutputPath === root) { | ||
throw new Error('Output path MUST not be project root directory!'); | ||
} | ||
|
||
removeSync(resolvedOutputPath); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters