opensolutions / minify
A JS and CSS minifier tool (with additional benefits for projects using template engines such as Smarty)
Installs: 36 165
Dependents: 1
Suggesters: 0
Security: 0
Stars: 8
Watchers: 4
Forks: 4
Open Issues: 0
This package is auto-updated.
Last update: 2024-11-19 05:44:17 UTC
README
Minify is a JS and CSS minifier toolkit (with support for generating templates for engines such as Smarty).
Its main features are:
- automatically find all CSS/JS files in a given directory named
xxx-blah.css
wherexxx
is a three digit ordering / sequence number; - minify these files and create a single file bundle;
- automatically generate template include files allowing production / development mode (i.e. use individual CSS/JS or bundles based on an application option);
- versioning for those using CDNs, future expiry dates, etc to ensure clients load fresh JS/CSS bundles.
See the Example Usage section below.
Usage
Using Minify is as simple as copying the included minify-options.php.dist
to minify-options.php
and editing to suit you environment. Then run the script:
./minify.php
A full destription of the available options is commented within minify-options.php.dist
and the script has a help option:
./minify.php --help
Installation Options
- It's a simple script - you can just clone the directory;
- Composer: require
"opensolutions/minify": "dev-master"
- Packagist: https://packagist.org/packages/opensolutions/minify
Example Usage
IXP Manager uses Minify. You can see IXP Manager's JS files here and its CSS files here.
The Minify script bundles the individual files into min.bundle-vX.css
and min.bundle-vX.js
files and also creates templates with logic for using the original uncompressed files or the compressed bundles in this file for CSS and this file for JS.
The configuration for generating these is here.
Used By
- ePayroll - Online payroll processing and management.
- IXP Manager - A web application to assist in the management of Internet Exchange Points (IXPs)
- TallyStick - Focus on what you love to do, while we take care of tracking your time.
- ViMbAdmin - Virtual Mailbox Administration
Do you use Minify? Do you want to get listed here? Drop us a note to info _at_ opensolutions _dot_ it
or open a pull request.
License and Copyright
Copyright (c) 2010 - 2014, Open Source Solutions Limited, Dublin, Ireland
Released under the BSD license:
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Thirdparty Tools
Minify includes two thirdparty tools:
- The Google Closure Compiler licensed under the Apache License, Version 2.0.
- Yahoo's YUI Compressor issued under a BSD license.