Skip to content

Latest commit

 

History

History
61 lines (49 loc) · 1.66 KB

README.md

File metadata and controls

61 lines (49 loc) · 1.66 KB

Laravel4 Minify Package

A Laravel 4 package for minifying your .css and .js. It caches the file with an uniq fingerprint. When you adjust your CSS/JS, your old cached/minified files are deleted, and a new cachefile is placed.

Installation

Instal it via composer

Add the following line in your composer.json

  "ceesvanegmond/minify": "dev-master"

Please add the following line in your config/app.php under 'providers'.

  'CeesVanEgmond\Minify\MinifyServiceProvider',

Run command

  composer update

Config

You can publish the config file, or you can edit it directly. There are several options.
'css_path' => The CSS path (from your public) defaults to '/css/'
'css_build_path' => The build path where the minified + concatenate build files are (relative from above aption) defaults to 'builds/'
'js_path' => The JS path (from your public) defaults to '/js/'
'js_build_path' => The build path where the minified + concatenate build files are (relative from above aption) defaults to 'builds/'

That's it, you can now start using the package

Usage

There are two helpers available to use, the 'stylesheet' helper, and the 'javascript' helper Example to minify your JavaScript (in .blade file)
{{ javascript(array(
  	'jquery-1.9.1.min.js',
		'hashchange.js',
		'tracer.js',
		'includes.js',
		'lightbox.js',
		'history.js',
		'transforms.js',
		'main.js',
		'ga.js'
	)) 
}}

Or CSS

{{ stylesheet('main.css') }}

You'll notice that you can set multiple files as an array, or just one file (string) The system will only react if you're' not on the 'local' environment!!!