1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618
|
.\" Man page generated from reStructuredText.
.
.TH CLOSURE-COMPILER 1 "2014-01-07" "" "Closure"
.SH NAME
closure-compiler \- optimising compiler for ECMAScript (JavaScript) programs
.
.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
..
.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 <name>[=<val>], where <name> is the name of a @define
variable and <val> is a boolean, number, or a single\-quot ed string
that contains no single quotes. If [=<val>] 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 <name>:<num\-js\-files>[:[<dep>,...][:]]].
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. <module\-name>.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 <name>:<wrapper>. 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
<file\-name>:<line\-number>? <warning\-d escription>
.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 <ben+ecmascript@benfinney.id.au>
.SH COPYRIGHT
Apache license, version 2.0.
.\" Generated by docutils manpage writer.
.
|