flynetworks/google-closure 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

flynetworks/google-closure

Composer 安装命令:

composer require flynetworks/google-closure

包简介

This package provides the google closure javascript library. Also a compile and deps command is available through the command line.

README 文档

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.

Option Type
id required string
inputs array[string]
paths array[string]
externs array[string]
customExternsOnly boolean
closureLibrary string
experimentalExcludeClosureLibrary boolean
mode RAW, WHITESPACE, SIMPLE, ADVANCED
level QUIET, DEFAULT, VERBOSE
inherits string
debug boolean
prettyPrint boolean
printInputDelimiter boolean
outputFile string
outputWrapper array[string]
outputCharset string
fingerprint boolean
modules object
moduleOutputPath string
moduleProductionUri string
moduleInfoPath string
globalScopeName string
define object
treatWarningsAsErrors boolean
exportTestFunctions boolean
nameSuffixesToStrip array[string]
typePrefixesToStrip array[string]
idGenerators array[string]
ambiguateProperties boolean
disambiguateProperties boolean
experimentalCompilerOptions object
customPasses object
soyFunctionPlugins array[string]
jsdocHtmlOutputPath string
variableMapInputFile string
variableMapOutputFile string
propertyMapInputFile string
propertyMapOutputFile string
testTemplate string
testExcludes array[string]

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

统计信息

  • 总下载量: 149
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: JavaScript

其他信息

  • 授权协议: LGPL-3.0
  • 更新时间: 2014-04-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固