ts-clean-built v1.3.1
ts-clean-built
Safely removes old/built
*.js *.d.ts *.js.mapfiles from working directory.
This is useful when for example you want to clean up working/output directory of old built (not actual) files not removing actual existing output (i.e when tsc --watch is running).
Install
npm install ts-clean-built -Dyarn add ts-clean-built --devUsage
ts-clean-built [--old|--all] [--exclude folder1 folder2] [dir]By default running without flags shows warning.
--built- for all found.tsfiles removes corresponding.js, .d.ts, .js.map.--old- will search.d.tsfiles and remove corresponding.js, .js.mapif no.ts/tsxversion exists.--allow-dts- used with--old, will not remove.d.tsif no corresponding.tsor.jsexists, allowing to have leave.d.tsfiles.--all- will remove all found.js, .d.ts, .js.mapfiles, potentially dangerous option.--dot- dot-folders excluded, to include use flag.--exclude- list of patterns to exclude from search, i.e.--exclude **/my-folder/**will exclude all files in all directories namedmy-folderin the tree.node_modules,bower_components,jspm_packagesare excluded by default.--dry- will not remove files, just show the list to going to delete.--files- outputs list of files removed.--quite- will not output log messages.--out- root, where to search output files, equals todirby default.--dir- root, where to search source (*.ts) files, is.(cwd) by default.[dir]- last argument, the same as--dir.--help- shows help info.
Recipe
Add script clean: ts-clean-built --old --out out --dir src to your package.json and run it when ever needed.
Licence
MIT.