Contao Open Source CMS > Enhance > Extension list > [js_minifier] Javascript minifier 1.0.0 stable

Extensions > js_minifier

[js_minifier] Javascript minifier

A javascript minifier

JavascriptMinifier is an extension for typolight that automatically packs javascript filesfor you. It also provides an inclusion mechanism.

It uses the Nicolas Martin's PHP port of Dean Edwards JavaScript's Packer.

  • http://joliclic.free.fr/php/javascript-packer/en/
  • http://dean.edwards.name/packer/

All you have to do is to create the frontend module "Javascript Minifier", select thefiles you want to pack in the file tree and add the module in your page or layout. Istrongly recommend that you put it just before closing the body tag, for perfs sake.

If you're an extension developer, you can add files to be minified just like you use TL_JAVASCRIPT :

$GLOBALS[ 'TL_JAVASCRIPT_MIN' ][] = 'path/to/file.js';

Options

The module support two options :

  • Encode : Set on to use minifier. If not set, files will only be concatenated ( default : on )
  • Debug : Set on not to cache the resulting file. Useful for developers. ( default : off )
  • Resolve dependencies : Set on to use the inclusion mechanism

Assembling order

Files from $GLOBALS[ 'TL_JAVASCRIPT_MIN' ] are treated first, in the order they appear in the array.

Then, each file selected in the module configuration is included, in alphabetical order, so you can determine the inclusion order simply by prefixing files with numbers.

If the inclusion mechanism is on, you can add on top of your javascript files things like :
// require 'other-file.js'

Path is relative to the including file.

Version1.0.0 stableTypeFree
Release date2010-02-22CategoryUtility
LicenseLGPL
Copyright© 2010, Olivier El Mekki
AuthorOlivier El Mekki (kik) http://olivier-elmekki.com
Release notes and change log for 1.0.0 stableOther versions
  • add inclusion mechanism
  • add possibility to use multiple minimized files (named after module name)
1.0.0 rc1
Release downloads10Total downloads15
Release installs31Total installs35
Release updates1Total updates1
Dependencies of this extensionOther extensions depending on this one
NameVersion fromVersion to
Contao2.7.0 stable2.8.2 stable
NameVersion fromVersion to
PackageSizeDate
Contao_js_minifier_10000009_9.zip203102011-08-13 03:27