Skip to content

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.

Notifications You must be signed in to change notification settings

jimmyko/laravel4-minify

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!!!

About

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.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%