A tool to clean obsolete hash-coded files, which created by building tools, like webpack, gulp.
Switch branches/tags
Nothing to show
Clone or download
Latest commit db181bd Nov 6, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
examples
src
test
.editorconfig use rollup to build Oct 23, 2018
.eslintignore
.eslintrc.js
.gitignore
.npmrc use rollup to build Oct 23, 2018
.prettierignore
.prettierrc.js
.travis.yml
CHANGELOG.md
LICENSE
README.md
jest.config.js
package.json
rollup.config.js use rollup to build Oct 23, 2018

README.md

sclean

A tool to clean obsolete hash-coded files, which created by building tools, like webpack, gulp.

quick start

Install sclean:

npm install sclean -g

command line

sclean <command> [args]

archive: archive target directory to a zip file

sclean archive <directory>

restore: restore target directory to last nth archive state

sclean restore <directory> [--index index]
  • index/i: int, default 1, last nth state to restore

clean: clean obsolete hash-code files

sclean clean <directory> [--ext ext] [--hash hash]
  • ext/e: type: string extra html extensions(split by ,, like --ext jsp,php)
  • hash/H: type: int default: 32 hash length

philosophy of cleaning obsolete files

  1. find all hash codes from html files (hashes1)
  2. find all hash codes from js files whose file name matches hashes1 (hashes2, async js bundles)
  3. delete js and css files whose file name neither matches hashes1 nor hashes2

addition

  • sclean only clean js and css files, not other static files