'\" -*- coding: utf-8 -*- .\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "CLOSURE-COMPILER" 1 "2014-01-07" "" "Closure" .SH NAME closure-compiler \- optimising compiler for ECMAScript (JavaScript) programs .SH SYNOPSIS .nf \fBclosure\-compiler\fP [ \fIOPTION\fP ... ] \fBclosure\-compiler\fP \fB\-\-help\fP .fi .sp .SH DESCRIPTION .sp The Closure Compiler Application is the command\-line interface to the Closure Compiler, part of the Closure Tools project. .sp The Closure Compiler is a tool for making ECMAScript (JavaScript) download and run faster. It parses your program, analyzes it, removes dead code, and rewrites and minimizes what\(aqs left. It also checks syntax, variable references, and types, and warns about common pitfalls. .SH OPTIONS .sp \fB\-\-help\fP .INDENT 0.0 .INDENT 3.5 Describe how to use the Closure Compiler Application. .UNINDENT .UNINDENT .sp \fB\-\-version\fP .INDENT 0.0 .INDENT 3.5 Print the Closure Compiler version to stderr. .UNINDENT .UNINDENT .sp \fB\-\-accept_const_keyword\fP .INDENT 0.0 .INDENT 3.5 Allow usage of const keyword. .UNINDENT .UNINDENT .sp \fB\-\-angular_pass\fP .INDENT 0.0 .INDENT 3.5 Generate $inject properties for AngularJS for functions annotated with \fB@ngInject\fP\&. .UNINDENT .UNINDENT .sp \fB\-\-charset\fP \fICHARSET\fP .INDENT 0.0 .INDENT 3.5 Specify \fICHARSET\fP to be the input and output charset for all files. By default, we accept UTF\-8 as input and output US_ASCII. .UNINDENT .UNINDENT .sp \fB\-\-closure_entry_point\fP \fIENTRYPOINT\fP .INDENT 0.0 .INDENT 3.5 Specify entry point \fIENTRYPOINT\fP to the program. Must be goog.provide\(aqd symbols. Any goog.provide\(aqd symbols that are not a transitive dependency of the entry points will be removed. Files without goog.provides, and their dependencies, will always be left in. If any entry points are specified, then the \fBmanage_closure_dependencies\fP option will be set to true and all files will be sorted in dependency order. .UNINDENT .UNINDENT .sp \fB\-\-common_js_entry_module\fP \fIMODULEFILE\fP .INDENT 0.0 .INDENT 3.5 Specify the root of your common JS dependency hierarchy to be \fIMODULEFILE\fP\&. Your main script. .UNINDENT .UNINDENT .sp \fB\-\-common_js_module_path_prefix\fP \fIPREFIX\fP .INDENT 0.0 .INDENT 3.5 Specify a path prefix \fIPREFIX\fP to be removed from CommonJS module names. .UNINDENT .UNINDENT .sp \fB\-\-compilation_level\fP \fILEVEL\fP .INDENT 0.0 .INDENT 3.5 Set the compilation level to \fILEVEL\fP\&. .sp Values: \fBWHITESPACE_ONLY\fP, \fBSIMPLE_OPTIMIZATIONS\fP, \fBADVANCED_OPTIMIZATIONS\fP\&. .UNINDENT .UNINDENT .sp \fB\-\-create_name_map_files\fP .INDENT 0.0 .INDENT 3.5 Specify that variable renaming and property renaming map files will be produced as {binary name}_vars_map.out and {binary name}_props_map.out. .sp Note that this flag cannot be used in conjunction with either \fBvariable_map_output_file\fP or \fBproperty_map_output_file\fP\&. .UNINDENT .UNINDENT .sp \fB\-\-create_source_map\fP \fIMAPFILE\fP .INDENT 0.0 .INDENT 3.5 Specify a source map file \fIMAPFILE\fP, mapping the generated source files back to the original source file will be output to the specified path. The \fB%outname%\fP placeholder will expand to the name of the output file that the source map corresponds to. .UNINDENT .UNINDENT .sp \fB\-\-debug\fP .INDENT 0.0 .INDENT 3.5 Enable debugging options. .UNINDENT .UNINDENT .sp \fB\-\-define\fP \fIDEFINITION\fP, \fB\-\-D\fP \fIDEFINITION\fP, \fB\-D\fP \fIDEFINITION\fP .INDENT 0.0 .INDENT 3.5 Override the value of a variable annotated @define. The format of \fIDEFINITION\fP is [=], where is the name of a @define variable and is a boolean, number, or a single\-quot ed string that contains no single quotes. If [=] is omitted, the variable is marked true. .UNINDENT .UNINDENT .sp \fB\-\-externs\fP \fIEXTERNFILE\fP .INDENT 0.0 .INDENT 3.5 Specify that the file \fIEXTERNFILE\fP contains JavaScript externs. .sp You may specify this option multiple times to specify additional \fIEXTERNFILE\fP files. .UNINDENT .UNINDENT .sp \fB\-\-extra_annotation_name\fP \fITAGNAME\fP .INDENT 0.0 .INDENT 3.5 Specify \fITAGNAME\fP to append to the whitelist of tag names in JSDoc. .sp You may specify this option multiple times to append additional \fITAGNAME\fP values. .UNINDENT .UNINDENT .sp \fB\-\-flagfile\fP \fIFILE\fP .INDENT 0.0 .INDENT 3.5 Specify that \fIFILE\fP contains additional command\-line options. .UNINDENT .UNINDENT .sp \fB\-\-formatting\fP \fIFORMATOPTION\fP .INDENT 0.0 .INDENT 3.5 Specifies the formatting option \fIFORMATOPTION\fP to apply to the output JS. .sp Values: \fBPRETTY_PRINT\fP, \fBPRINT_INPUT_DELIMITER\fP, \fBSINGLE_QUOTES\fP .UNINDENT .UNINDENT .sp \fB\-\-generate_exports\fP .INDENT 0.0 .INDENT 3.5 Generates export code for those marked with @export. .UNINDENT .UNINDENT .sp \fB\-\-js\fP \fIINFILE\fP .INDENT 0.0 .INDENT 3.5 Specify \fIINFILE\fP as an input filename. .sp You may specify this option multiple times to append additional \fIINFILE\fP names. .UNINDENT .UNINDENT .sp \fB\-\-js_output_file\fP \fIOUTFILE\fP .INDENT 0.0 .INDENT 3.5 Specify \fIOUTFILE\fP as the primary output filename. .sp If not specified, output is written to stdout. .UNINDENT .UNINDENT .sp \fB\-\-jscomp_error\fP \fIWARNCLASS\fP .INDENT 0.0 .INDENT 3.5 Make the named class of warnings \fIWARNCLASS\fP an error. .sp See \fI\%Warning Classes\fP, below, for the list of valid \fIWARNCLASS\fP names. .UNINDENT .UNINDENT .sp \fB\-\-jscomp_off\fP \fIWARNCLASS\fP .INDENT 0.0 .INDENT 3.5 Turn off the named class of warnings \fIWARNCLASS\fP\&. .sp See \fI\%Warning Classes\fP, below, for the list of valid \fIWARNCLASS\fP names. .UNINDENT .UNINDENT .sp \fB\-\-jscomp_warning\fP \fIWARNCLASS\fP .INDENT 0.0 .INDENT 3.5 Make the named class of warnings \fIWARNCLASS\fP a normal warning. .sp See \fI\%Warning Classes\fP, below, for the list of valid \fIWARNCLASS\fP names. .UNINDENT .UNINDENT .sp \fB\-\-language_in\fP \fILANGSPEC\fP .INDENT 0.0 .INDENT 3.5 Specify the input sources conform to the language \fILANGSPEC\fP\&. .sp Values: \fBECMASCRIPT3\fP (default), \fBECMASCRIPT5\fP, \fBECMASCRIPT5_STRICT\fP\&. .UNINDENT .UNINDENT .sp \fB\-\-logging_level\fP \fILEVEL\fP .INDENT 0.0 .INDENT 3.5 Specify \fILEVEL\fP as the logging level (standard java.util. logging.Level values) for Compiler progress. Does not control errors or warnings for the JavaScript code under compilation. .UNINDENT .UNINDENT .sp \fB\-\-manage_closure_dependencies\fP .INDENT 0.0 .INDENT 3.5 Automatically sort dependencies so that a file that goog.provides symbol X will always come before a file that goog.requires symbol X. If an input provides symbols, and those symbols are never required, then that input will not be included in the compilation. .UNINDENT .UNINDENT .sp \fB\-\-module\fP \fIMODULESPEC\fP .INDENT 0.0 .INDENT 3.5 Specify the JavaScript module specification \fIMODULESPEC\fP\&. .sp The format for \fIMODULESPEC\fP is :[:[,...][:]]]. Module names must be unique. Each dep is the name of a module that this module depends on. Modules must be listed in dependency order, and JS source files must be listed in the corresponding order. Where \fB\-\-module\fP flags occur in relation to \fB\-\-js\fP flags is unimportant. Provide the value \fBauto\fP to trigger module creation from CommonJSmodules. .UNINDENT .UNINDENT .sp \fB\-\-module_output_path_prefix\fP \fIPREFIX\fP .INDENT 0.0 .INDENT 3.5 Specify the filename prefix \fIPREFIX\fP for filenames of compiled JS modules. .js will be appended to this prefix. Directories will be created as needed. Use with \fB\-\-module\fP\&. .UNINDENT .UNINDENT .sp \fB\-\-module_wrapper\fP \fIWRAPPER\fP .INDENT 0.0 .INDENT 3.5 Specify \fIWRAPPER\fP as output wrapper for a JavaScript module (optional). .sp The format of \fIWRAPPER\fP is :. The module name must correspond with a module specified using \fB\-\-module\fP\&. The wrapper must contain %s as the code placeholder. The %basename% placeholder can also be used to substitute the base name of the module output file. .UNINDENT .UNINDENT .sp \fB\-\-only_closure_dependencies\fP .INDENT 0.0 .INDENT 3.5 Only include files in the transitive dependency of the entry points (specified by closure_entry_point). Files that do not provide dependencies will be removed. This supersedes \fBmanage_closure_dependencies\fP\&. .UNINDENT .UNINDENT .sp \fB\-\-output_manifest\fP \fIMANIFESTFILE\fP .INDENT 0.0 .INDENT 3.5 Prints out a list of all the files in the compilation to \fIMANIFESTFILE\fP\&. .sp If \fB\-\-manage_closure_dependencies\fP is on, this will not include files that got dropped because they were not required. .sp The \fB%outname%\fP placeholder expands to the JS output file. If you\(aqre using modularization, using \fB%outname%\fP will create a manifest for each module. .UNINDENT .UNINDENT .sp \fB\-\-output_module_dependencies\fP \fIDEPFILE\fP .INDENT 0.0 .INDENT 3.5 Prints out a JSON file \fIDEPFILE\fP of dependencies between modules. .UNINDENT .UNINDENT .sp \fB\-\-output_wrapper\fP \fIWRAPPER\fP .INDENT 0.0 .INDENT 3.5 Interpolate output into \fIWRAPPER\fP at the place denoted by the marker token \fB%output%\fP\&. Use marker token \fB%output|jsstring%\fP to do js string escaping on the output. .UNINDENT .UNINDENT .sp \fB\-\-print_ast\fP .INDENT 0.0 .INDENT 3.5 Print a dot file describing the internal abstract syntax tree and exit. .UNINDENT .UNINDENT .sp \fB\-\-print_pass_graph\fP .INDENT 0.0 .INDENT 3.5 Print a dot file describing the passes that will get run and exit. .UNINDENT .UNINDENT .sp \fB\-\-print_tree\fP .INDENT 0.0 .INDENT 3.5 Print out the parse tree and exit. .UNINDENT .UNINDENT .sp \fB\-\-process_closure_primitives\fP .INDENT 0.0 .INDENT 3.5 Processes built\-ins from the Closure library, such as goog.require(), goog.provide(), and goog.exportSymbol(). .UNINDENT .UNINDENT .sp \fB\-\-process_common_js_modules\fP .INDENT 0.0 .INDENT 3.5 Process CommonJS modules to a concatenable form. .UNINDENT .UNINDENT .sp \fB\-\-process_jquery_primitives\fP .INDENT 0.0 .INDENT 3.5 Processes built\-ins from the JQuery library, such as jQuery.fn and jQuery.extend(). .UNINDENT .UNINDENT .sp \fB\-\-property_map_input_file\fP \fIMAPFILE\fP .INDENT 0.0 .INDENT 3.5 Specify \fIMAPFILE\fP as containing the serialized version of the property renaming map produced by a previous compilation. .UNINDENT .UNINDENT .sp \fB\-\-property_map_output_file\fP \fIMAPFILE\fP .INDENT 0.0 .INDENT 3.5 Save the serialized version of the property renaming map produced to \fIMAPFILE\fP\&. .UNINDENT .UNINDENT .sp \fB\-\-source_map_format\fP \fIFORMAT\fP .INDENT 0.0 .INDENT 3.5 Product the source map in format \fIFORMAT\fP\&. .sp Values: \fBV1\fP, \fBV2\fP, \fBV3\fP, \fBDEFAULT\fP\&. \fBDEFAULT\fP produces \fBV2\fP\&. .UNINDENT .UNINDENT .sp \fB\-\-summary_detail_level\fP \fILEVEL\fP .INDENT 0.0 .INDENT 3.5 Specify the compilation summary detail level \fILEVEL\fP\&. .sp Values: \fB0\fP (never print summary), \fB1\fP (print summary only if there are errors or warnings), \fB2\fP (print summary if the \(aqcheckTypes\(aq diagnostic group is enabled, see \fB\-\-jscomp_warning\fP), \fB3\fP (always print summary). The default level is \fB1\fP\&. .UNINDENT .UNINDENT .sp \fB\-\-third_party\fP .INDENT 0.0 .INDENT 3.5 Check source validity but do not enforce Closure style rules and conventions. .UNINDENT .UNINDENT .sp \fB\-\-transform_amd_modules\fP .INDENT 0.0 .INDENT 3.5 Transform AMD to CommonJS modules. .UNINDENT .UNINDENT .sp \fB\-\-translations_file\fP \fITRANSFILE\fP .INDENT 0.0 .INDENT 3.5 Specify \fITRANSFILE\fP as the source of translated messages. Currently only supports XTB. .UNINDENT .UNINDENT .sp \fB\-\-translations_project\fP \fIPROJECT\fP .INDENT 0.0 .INDENT 3.5 Scope all translations to the specified project. .sp When specified, use different message ids so that messages in different projects can have different translations. .UNINDENT .UNINDENT .sp \fB\-\-use_only_custom_externs\fP .INDENT 0.0 .INDENT 3.5 Specifies that the default externs should be excluded. .UNINDENT .UNINDENT .sp \fB\-\-use_types_for_optimization\fP .INDENT 0.0 .INDENT 3.5 Experimental: perform additional optimizations based on available information. Inaccurate type annotations may result in incorrect results. .UNINDENT .UNINDENT .sp \fB\-\-variable_map_input_file\fP \fIMAPFILE\fP .INDENT 0.0 .INDENT 3.5 Specify \fIMAPFILE\fP as containing the serialized version of the variable renaming map produced by a previous compilation. .UNINDENT .UNINDENT .sp \fB\-\-variable_map_output_file\fP \fIMAPFILE\fP .INDENT 0.0 .INDENT 3.5 Save the serialized version of the variable renaming map produced to \fIMAPFILE\fP\&. .UNINDENT .UNINDENT .sp \fB\-\-warning_level\fP \fILEVEL\fP .INDENT 0.0 .INDENT 3.5 Specify the warning level to use. .sp Values: \fBQUIET\fP, \fBDEFAULT\fP, \fBVERBOSE\fP\&. .UNINDENT .UNINDENT .sp \fB\-\-warnings_whitelist_file\fP \fILISTFILE\fP .INDENT 0.0 .INDENT 3.5 Suppress warnings listed in \fILISTFILE\fP\&. Each line should be of the form :? .UNINDENT .UNINDENT .SS Warning Classes .sp The \fBjscomp_error\fP, \fBjscomp_warning\fP, and \fBjscomp_off\fP flags require as a parameter a \fIWARNCLASS\fP warning class name. The following names are valid warning class names: .INDENT 0.0 .IP \(bu 2 \fBaccessControls\fP .IP \(bu 2 \fBambiguousFunctionDecl\fP .IP \(bu 2 \fBcheckRegExp\fP .IP \(bu 2 \fBcheckTypes\fP .IP \(bu 2 \fBcheckVars\fP .IP \(bu 2 \fBconst\fP .IP \(bu 2 \fBconstantProperty\fP .IP \(bu 2 \fBdeprecated\fP .IP \(bu 2 \fBduplicateMessage\fP .IP \(bu 2 \fBes5Strict\fP .IP \(bu 2 \fBexternsValidation\fP .IP \(bu 2 \fBfileoverviewTags\fP .IP \(bu 2 \fBglobalThis\fP .IP \(bu 2 \fBinternetExplorerChecks\fP .IP \(bu 2 \fBinvalidCasts\fP .IP \(bu 2 \fBmisplacedTypeAnnotation\fP .IP \(bu 2 \fBmissingProperties\fP .IP \(bu 2 \fBnonStandardJsDocs\fP .IP \(bu 2 \fBsuspiciousCode\fP .IP \(bu 2 \fBstrictModuleDepCheck\fP .IP \(bu 2 \fBtypeInvalidation\fP .IP \(bu 2 \fBundefinedNames\fP .IP \(bu 2 \fBundefinedVars\fP .IP \(bu 2 \fBunknownDefines\fP .IP \(bu 2 \fBuselessCode\fP .IP \(bu 2 \fBvisibility\fP .UNINDENT .SH EXAMPLE .INDENT 0.0 .IP \(bu 2 .nf \fBclosure\-compiler\fP \-\-js hello.js \-\-js_output_file hello\-compiled.js .fi .sp .sp This command creates a new file called \fBhello\-compiled.js\fP, which contains the compiled program. .UNINDENT .SH HISTORY .sp The Closure Tools project is an effort by Google engineers to open source the tools used in many of Google\(aqs sites and web applications for use by the wider Web development community. .sp This manual page was written by Ben Finney <\fI\%ben+ecmascript@benfinney.id.au\fP> to document the \fBclosure\-compiler\fP command for Debian. It is free software and may be used by others under the terms of the Apache license, version 2.0\&. .\" Local variables: .\" mode: rst .\" coding: utf-8 .\" time-stamp-format: "%:y-%02m-%02d" .\" time-stamp-start: "^:Date:[ ]+" .\" time-stamp-end: "$" .\" time-stamp-line-limit: 20 .\" End: .\" vim: filetype=rst fileencoding=utf-8 : . .SH AUTHOR Ben Finney .SH COPYRIGHT Apache license, version 2.0. .\" Generated by docutils manpage writer. .