All Projects → kylekatarnls → uglify

kylekatarnls / uglify

Licence: MIT license
PHP wrapper to execute uglify-js/clean-css node package or fallback to PHP alternatives

Programming Languages

PHP
23972 projects - #3 most used programming language
javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to uglify

phaser-typescript-webpack
Another Phaser CE boilerplate using TypeScript and Webpack.
Stars: ✭ 17 (+6.25%)
Mutual labels:  uglify, minify
Terser Webpack Plugin
Terser Plugin
Stars: ✭ 1,687 (+10443.75%)
Mutual labels:  uglify, minify
express-minify
Automatically minify and cache your javascript and css files.
Stars: ✭ 85 (+431.25%)
Mutual labels:  minify, uglifyjs
minifier
Middleware to minify Html, CSS and Javascript responses
Stars: ✭ 15 (-6.25%)
Mutual labels:  uglify, minify
gulp-starter-kit
My Gulp Starter Kit
Stars: ✭ 91 (+468.75%)
Mutual labels:  uglify
Glup
Some of the gulp tutorial -《gulp笔记》
Stars: ✭ 136 (+750%)
Mutual labels:  minify
Minify
CSS & JavaScript minifier, in PHP. Removes whitespace, strips comments, combines files (incl. @import statements and small assets in CSS files), and optimizes/shortens a few common programming patterns.
Stars: ✭ 1,710 (+10587.5%)
Mutual labels:  minify
Serverless Plugin Optimize
Bundle with Browserify, transpile and minify with Babel automatically to your NodeJS runtime compatible JavaScript
Stars: ✭ 122 (+662.5%)
Mutual labels:  minify
Minify
Minifier of js, css, html and img
Stars: ✭ 120 (+650%)
Mutual labels:  minify
Autoptimize
Official Autoptimize repo on Github
Stars: ✭ 245 (+1431.25%)
Mutual labels:  minify
Minify
Go minifiers for web formats
Stars: ✭ 2,824 (+17550%)
Mutual labels:  minify
Yii2 Minify View
Yii2 View component with minification css & js
Stars: ✭ 186 (+1062.5%)
Mutual labels:  minify
Javascript Obfuscator
A powerful obfuscator for JavaScript and Node.js
Stars: ✭ 8,204 (+51175%)
Mutual labels:  uglify
Yui Css Compressor Php Port
A PHP port of the YUI CSS compressor.
Stars: ✭ 220 (+1275%)
Mutual labels:  minify
Instapack
All-in-one TypeScript and Sass compiler for web applications! 📦 🚀
Stars: ✭ 131 (+718.75%)
Mutual labels:  minify
gulp-uglifycss
Gulp plugin to use uglifycss
Stars: ✭ 24 (+50%)
Mutual labels:  uglify
flask minify
A Flask extension to minify request's response for html, js, css and less.
Stars: ✭ 59 (+268.75%)
Mutual labels:  minify
Image Shrinker
App for macOS. Minify your images and graphics with just one drop. Autorenamed in the same place where it comes from. Immediately!
Stars: ✭ 217 (+1256.25%)
Mutual labels:  minify
MinifyAll
A 𝗩𝗦𝗖𝗼𝗱𝗲 𝗺𝗶𝗻𝗶𝗳𝗶𝗲𝗿 for JS, JSON/C, CSS, and HTML, you will love its simplicity! 🌟 𝘾𝙤𝙢𝙥𝙧𝙚𝙨𝙨 and 𝙜𝙯𝙞𝙥 files and folders 📦 Reduce your bundle and file sizes with lightning speed ⚡
Stars: ✭ 54 (+237.5%)
Mutual labels:  minify
rollup-plugin-closure-compiler-js
Rollup plugin for optimizing JavaScript with google-closure-compiler-js.
Stars: ✭ 31 (+93.75%)
Mutual labels:  minify

uglify

Latest Stable Version Build Status StyleCI Test Coverage Code Climate

Simple PHP class to minify both your javascript and css the best existing way (uglify-js for JS, clean-css for CSS) and if node is not available, PHP fallbacks are used instead.

Usage

First you need composer if you have not already. Then get the package with composer require nodejs-php-fallback/uglify then require the composer autload in your PHP file if it's not already:

<?php

use NodejsPhpFallback\Uglify;

// Require the composer autoload in your PHP file if it's not already.
// You do not need to if you use a framework with composer like Symfony, Laravel, etc.
require 'vendor/autoload.php';

$uglify = new Uglify(array(
    'path/to/my-first-file.js',
    'path/to/my-second-file.js',
));
$uglify->add('path/to/my-thrid-file.js');

// Output to a file:
$uglify->write('path/to/destination.min.js');

// Output to the browser:
header('Content-type: text/javascript');
echo $uglify;

Uglify will use js minification by default. If the first source path end with .css or you use ->write() with a path ending with .css, it will switch to CSS mode. Else you can switch manually or get explicitly JS/CSS minified:

$uglify->jsMode();
echo $uglify; // display minified javascript
$uglify->cssMode();
echo $uglify; // display minified css

// or
echo $uglify->getMinifiedJs(); // display minified javascript
echo $uglify->getMinifiedCss(); // display minified css

Security contact information

To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].