/ng-builder-file-remover

Angular 8+ builder for removing files

Primary LanguageTypeScriptMIT LicenseMIT

CircleCI npm NPM

Angular builder that removes specified files and folders.

Usage

Install library in project root

npm i -D ng-builder-file-remover

In angular.json add configuration under architect

"file-remover": {
    "builder": "ng-builder-file-remover:remove",
    "options": {
        "files": [
            "todelete.txt",
            "random_folder"
        ]
    }
},

And run it

ng run [project-name]:file-remover

This should output something similar to

> ng run builder-example:file-remover
Starting file removing
Deleted todelete.txt
Deleted random_folder
✔ Removing files finished successfully

Version compatibility

Since Angular 13 library follows Angular version.

Angular version Library version
<13 0.1.6
13 13

Development

To build run

npm install
npm run build

For testing you need to use existing or create a new Angular 8+ project

For creating a new project simply use

ng new remover-test-project

Go inside the project and in angular.json under architect add local path to the project.

"file-remover": {
    "builder": "../ng-builder-file-remover:remove",
    "options": {
        "files": [
            "file.txt"
        ]
    }
},

Run the command

ng run remover-test-project:file-remover