GithubHelp home page GithubHelp logo

jzfdav / minify_recursive Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chia/minify_recursive

0.0 2.0 0.0 108 KB

Minify all css or js in a folder recursively using YUIcompressor

Shell 100.00%

minify_recursive's Introduction

minify_recursive

Minify_recursive is a shell script that uses YUICOMPRESSOR to minify all css and js files recursively in a directory.

Requirements

The only requirement is to install YUICOMPRESSOR https://github.com/yui/yuicompressor

Installation

  1. Configure path to YUICOMPRESSOR_PATH by editing the minify_recursive.sh file
  2. Create a soft link of minify_recursive script in /usr/local/bin ln -s minify_recursive.sh /usr/local/bin/minify_recursive
  3. Give execute permission to minify_recursive script chmod +x minify_recursive.sh

Use case #1 (My usecase)

I had a project and wanted to create a git pre hook to recursively minify all files in my project. Hence this small script came into existence. It does 1 thing and does it pretty well for me. Minify all files in a directory and put it in minified directory.

Here how it works

I have throwed this shell script into /usr/local/bin
  • minify_recursive css # This will recursively minify all css in your pwd (present directory)
  • minify_recursive js # Recursively minify all js file in pwd
  • minify_recursive js /var/www/html/myproject # This will recursively minify all js file in myproject directory.

If your using drupal like me, you can use

  • hook_js_alter($javascript)
  • hook_css_alter($css)
and point your css and js in your custom directory to minified folder created by this script

minify_recursive's People

Contributors

chia avatar

Watchers

James Cloos avatar Joseph K Sreenath avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.