flynetworks / google-closure
This package provides the google closure javascript library. Also a compile and deps command is available through the command line.
Installs: 149
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
Open Issues: 0
Language:JavaScript
Type:typo3-flow-package
Requires
- typo3/flow: *
This package is not auto-updated.
Last update: 2024-12-21 16:00:05 UTC
README
##Google Closure Package for TYPO3 Flow
Installation
I recommend to install this package using composer.
Just require the flynetworks/google-closure
package in your composer.json
"require": { "flynetworks/google-closure": "2.*" }
Basic Configuration
After you have the package installed there is a new configuration file "GoogleClosure.yaml" available to you.
This file has basically the following structure:
UniqueIdentifier:
compiler:
options:
Example
MyUniqueKey:
compiler:
options:
id: 'my-project-id'
externs:
- 'resource://My.Package/Public/JavaScripts/Externs/SomeExterns.js'
paths:
- 'resource://My.Package/Public/JavaScripts/'
moduleOutputPath: 'resource://My.Package/Public/JavaScripts/%s.min.js'
moduleProductionUri: 'resource://My.Package/Public/JavaScripts/%s.min.js'
modules:
'Application':
deps: []
inputs:
- 'resource://My.Package/Public/JavaScripts/Application.js'
Don't use a dot "." for the UniqueIdentifier! I recommend to use only alphanumeric characters.
Within the "options" property you can start to configure the compiler parameters.
Available compiler options:
This package is using the plovr build tool.
A documentation about
the options you can use is located here: http://plovr.com/options.html
In the list below all options are listed with their corresponding type.
Advanced Configuration
There are some more configuration properties available to you.
Just see the example below.
MyFancyConfiguration:
embedMode: 'dependency' #Viewhelper renders the dependency version
dependency:
command: 'python %FLOW_PATH_PACKAGES%Application/My.Cool.Package/Resources/Public/closure/bin/build/depswriter.py'
outputFileName: 'MyCustomDepsFileName.js'
compiler:
command: 'java -jar %FLOW_PATH_PACKAGES%Application/My.Cool.Package/Resources/Private/Bin/Plovr.jar build'
ChildConfiguration:
embedMode: 'compiled' #Viewhelper renders the compiled version
extends: 'MyFancyConfiguration'
compiler:
command: 'java -jar %FLOW_PATH_PACKAGES%Application/Super.Child.Package/Resources/Private/Bin/Plovr.jar build'
ViewHelper
Also a ViewHelper "EmbedScriptViewHelper" is available through this package :)
{namespace gc=FlyNetworks\Google\Closure\ViewHelpers}
<!DOCTYPE html>
<html>
<head>
<gc:embedScript configurationKey="MyFancyConfiguration" />
<gc:embedScript configurationKey="ChildConfiguration" />
</head>
</html>
Commands
./flow closure:compile
./flow closure:dependency