ePages 6.11.0 - DE_EPAGES/JQuery/API/ClosureCompiler.pm

Package DE_EPAGES::JQuery::API::ClosureCompiler

This module provides an API for the Google ClosureCompiler Javascript minifier.

@EXPORT_OK
MinifyJavaScript
MinifyTemplate
MinifySourceCode

Functions

MinifyJavaScript
MinifySourceCode
MinifyTemplate

MinifyJavaScript

Minifies the javascript source code in the given source file and writes the minfied content to the target file.

Syntax
MinifyJavaScript($SourceFilePath, $TargetFilePath);
Input
$SourceFilePath (string)
javascript source (full file path and name)
$TargetFilePath (string)
target for output (full file path and name)
$hParams (ref.hash)
minifier parameters
  • Debug - debugging messages, verbose minifier (optional) - boolean

MinifySourceCode

Minifies the given javascript source code string and returns the output as a string.

Syntax
MinifySourceCode($rSourceString);
Input
$rSourceString (ref.string)
unminified source code
Return
$rTargetString (ref.string)
minified source code (full file path and name)

MinifyTemplate

Minifies the javascript source code inside a given source html template file and writes the template contant with the minfied javascript code to the target file.

Syntax
MinifyTemplate($SourceFilePath, $TargetFilePath);
Input
$SourceFilePath (string)
template source (full file path and name)
$TargetFilePath (string)
target for output (full file path and name)