GitXplorerGitXplorer
P

web-minify-helper

public
14 stars
14 forks
14 issues

Commits

List of commits on branch master.
Verified
24d522781ccebcb311f855d3623e07027bf5034b

Merge pull request #35 from PeterDaveHello/dependabot/add-v2-config-file

PPeterDaveHello committed 3 years ago
Verified
46850f7fa45fc4f1bf9c2eacfbbe0eb0c8024b19

Upgrade to GitHub-native Dependabot

ddependabot-preview[bot] committed 3 years ago
Verified
17ad1232439c6b8c51073c2cd9ac9a5e38b55a8b

Merge pull request #25 from PeterDaveHello/renovate/configure

PPeterDaveHello committed 5 years ago
Verified
36e58469ce38ea088ae2047fdd258aa24991d0e5

Add renovate.json

rrenovate-bot committed 5 years ago
Verified
8222cd72a8d685199e9a74524b01331a5f64d1fc

Merge pull request #24 from PeterDaveHello/dependabot/npm_and_yarn/uglify-js-tw-3.4.6

PPeterDaveHello committed 6 years ago
Unverified
4eac2e1e1eed3f507b7ee764066a32ec73aaad19

Update uglify-js requirement to ^3.4.6

ddependabot-support committed 6 years ago

README

The README file for this repository.

Web minify helper!

Gitter chat dependencies Status

Let me help you minify css and js files automatically and easily!

This is only a shell script; it depends on bash shell, grep, curl and nodejs/npm.

It is based on clean-css, uglify-js and javascript-minifier.com/cssminifier.com.

Feel free to contribute to the project if you want!

Requirements

  • Bash shell
  • grep
  • curl
  • Node.js >= (4.0)

How to use?

$ git clone --recursive https://github.com/PeterDaveHello/web-minify-helper.git
$ cd web-minify-helper
$ npm install

First go to the target directory you want to minify, then run the script(path_of_script/minify.sh). Or you can pass the directory's path as a parameter to the script!

You may even place the script file (or make a link to it) under the $HOME/bin directory, allowing you to conveniently run this script from any directory!

Explanation

The script will scan all the directories under the current working directory, except path with '.git'.

Then, it will check all the js & css files to see if they already have a minified version (currently, it recognizes it by looking for a .min in the filename, before the file extension).

If the file does not have a minified version, it will minify it.

Furthermore, even if there is a minified version available, the script will compare the last modified time between the original file and its minified version. If the original one is newer than the minified one -- which means the minified file is older than the original -- then it will replace the old minified file with a new minified version!