Created
June 19, 2018 23:27
-
-
Save codybonney/5082b1e34793826eab616089630e0922 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Basic Usage: | |
--compilation_level (-O) VAL : Specifies the compilation level to | |
use. Options: BUNDLE, WHITESPACE_ONLY, | |
SIMPLE (default), ADVANCED (default: | |
SIMPLE) | |
--env [BROWSER | CUSTOM] : Determines the set of builtin externs | |
to load. Options: BROWSER, CUSTOM. | |
Defaults to BROWSER. (default: | |
BROWSER) | |
--externs VAL : The file containing JavaScript | |
externs. You may specify multiple | |
--js VAL : The JavaScript filename. You may | |
specify multiple. The flag name is | |
optional, because args are | |
interpreted as files by default. You | |
may also use minimatch-style glob | |
patterns. For example, use | |
--js='**.js' --js='!**_test.js' to | |
recursively include all js files that | |
do not end in _test.js | |
--js_output_file VAL : Primary output filename. If not | |
specified, output is written to | |
stdout (default: ) | |
--language_in VAL : Sets the language spec to which input | |
sources should conform. Options: | |
ECMASCRIPT3, ECMASCRIPT5, | |
ECMASCRIPT5_STRICT, ECMASCRIPT6_TYPED | |
(experimental), ECMASCRIPT_2015, | |
ECMASCRIPT_2016, ECMASCRIPT_2017, | |
ECMASCRIPT_NEXT (default: | |
ECMASCRIPT_2017) | |
--language_out VAL : Sets the language spec to which | |
output should conform. Options: | |
ECMASCRIPT3, ECMASCRIPT5, | |
ECMASCRIPT5_STRICT, ECMASCRIPT6_TYPED | |
(experimental), ECMASCRIPT_2015, | |
ECMASCRIPT_2016, ECMASCRIPT_2017, | |
ECMASCRIPT_NEXT, NO_TRANSPILE | |
(default: ECMASCRIPT5) | |
--warning_level (-W) [QUIET | DEFAULT : Specifies the warning level to use. | |
| VERBOSE] Options: QUIET, DEFAULT, VERBOSE | |
(default: DEFAULT) | |
Warning and Error Management: | |
--conformance_configs VAL : A list of JS Conformance | |
configurations in text protocol | |
buffer format. | |
--error_format [STANDARD | JSON] : Specifies format for error messages. | |
(default: STANDARD) | |
--extra_annotation_name VAL : A whitelist of tag names in JSDoc. | |
You may specify multiple | |
--hide_warnings_for VAL : If specified, files whose path | |
contains this string will have their | |
warnings hidden. You may specify | |
multiple. | |
--jscomp_error VAL : Make the named class of warnings an | |
error. Must be one of the error group | |
items. '*' adds all supported. | |
--jscomp_off VAL : Turn off the named class of warnings. | |
Must be one of the error group items. | |
'*' adds all supported. | |
--jscomp_warning VAL : Make the named class of warnings a | |
normal warning. Must be one of the | |
error group items. '*' adds all | |
supported. | |
--strict_mode_input : Assume input sources are to run in | |
strict mode. (default: true) | |
--warnings_whitelist_file VAL : A file containing warnings to | |
suppress. Each line should be of the | |
form | |
<file-name>:<line-number>? | |
<warning-description> (default: ) | |
Available Error Groups: accessControls, ambiguousFunctionDecl, | |
checkRegExp, checkTypes, checkVars, conformanceViolations, const, | |
constantProperty, deprecated, deprecatedAnnotations, duplicateMessage, es3, | |
es5Strict, externsValidation, fileoverviewTags, functionParams, globalThis, | |
internetExplorerChecks, invalidCasts, misplacedTypeAnnotation, | |
missingGetCssName, missingOverride, missingPolyfill, missingProperties, | |
missingProvide, missingRequire, missingReturn, moduleLoad, msgDescriptions, | |
newCheckTypes, nonStandardJsDocs, missingSourcesWarnings, | |
reportUnknownTypes, suspiciousCode, strictCheckTypes, | |
strictMissingProperties, strictModuleDepCheck, strictPrimitiveOperators, | |
typeInvalidation, undefinedNames, undefinedVars, unknownDefines, | |
unusedLocalVariables, unusedPrivateMembers, uselessCode, useOfGoogBase, | |
underscore, visibility | |
Output: | |
--assume_function_wrapper : Enable additional optimizations based | |
on the assumption that the output | |
will be wrapped with a function | |
wrapper. This flag is used to | |
indicate that "global" declarations | |
will not actually be global but | |
instead isolated to the compilation | |
unit. This enables additional | |
optimizations. (default: false) | |
--export_local_property_definitions : Generates export code for local | |
properties marked with @export | |
(default: false) | |
--formatting [PRETTY_PRINT | : Specifies which formatting options, | |
PRINT_INPUT_DELIMITER | SINGLE_QUOTES] if any, should be applied to the | |
output JS. Options: PRETTY_PRINT, | |
PRINT_INPUT_DELIMITER, SINGLE_QUOTES | |
--generate_exports : Generates export code for those | |
marked with @export (default: false) | |
--isolation_mode [NONE | IIFE] : If set to IIFE the compiler output | |
will follow the form: | |
(function(){%output%)).call(this); | |
Options: NONE, IIFE (default: NONE) | |
--output_wrapper VAL : Interpolate output into this string | |
at the place denoted by the marker | |
token %output%. Use marker token | |
%output|jsstring% to do js string | |
escaping on the output. Consider | |
using the --isolation_mode flag | |
instead. (default: ) | |
--output_wrapper_file VAL : Loads the specified file and passes | |
the file contents to the | |
--output_wrapper flag, replacing the | |
value if it exists. This is useful if | |
you want special characters like | |
newline in the wrapper. (default: ) | |
--rename_prefix_namespace VAL : Specifies the name of an object that | |
will be used to store all non-extern | |
globals | |
--rename_variable_prefix VAL : Specifies a prefix that will be | |
prepended to all variables. | |
Dependency Management: | |
--dependency_mode [NONE | LOOSE | : Specifies how the compiler should | |
STRICT] determine the set and order of files | |
for a compilation. Options: NONE the | |
compiler will include all src files | |
in the order listed, STRICT files | |
will be included and sorted by | |
starting from namespaces or files | |
listed by the --entry_point flag - | |
files will only be included if they | |
are referenced by a goog.require or | |
CommonJS require or ES6 import, LOOSE | |
same as with STRICT but files which | |
do not goog.provide a namespace and | |
are not modules will be automatically | |
added as --entry_point entries. | |
Defaults to NONE. (default: NONE) | |
--entry_point VAL : A file or namespace to use as the | |
starting point for determining which | |
src files to include in the | |
compilation. ES6 and CommonJS modules | |
are specified as file paths (without | |
the extension). Closure-library | |
namespaces are specified with a | |
"goog:" prefix. Example: | |
--entry_point=goog:goog.Promise | |
JS Modules: | |
--js_module_root VAL : Path prefixes to be removed from ES6 | |
& CommonJS modules. | |
--module_resolution [BROWSER | : Specifies how the compiler locates | |
BROWSER_WITH_TRANSFORMED_PREFIXES | modules. BROWSER requires all module | |
NODE | WEBPACK] imports to begin with a '.' or '/' | |
and have a file extension. NODE uses | |
the node module rules. WEBPACK looks | |
up modules from a special lookup map. | |
(default: BROWSER) | |
--package_json_entry_names VAL : Ordered list of entries to look for | |
in package.json files when processing | |
modules with the NODE module | |
resolution strategy (i.e. | |
esnext:main,browser,main). Defaults | |
to a list with the following entries: | |
"browser", "module", "main". | |
--process_common_js_modules : Process CommonJS modules to a | |
concatenable form. (default: false) | |
Library and Framework Specific: | |
--angular_pass : Generate $inject properties for | |
AngularJS for functions annotated | |
with @ngInject (default: false) | |
--dart_pass : Rewrite Dart Dev Compiler output to | |
be compiler-friendly. (default: false) | |
--force_inject_library VAL : Force injection of named runtime | |
libraries. The format is <name> where | |
<name> is the name of a runtime | |
library. Possible libraries include: | |
base, es6_runtime, runtime_type_check | |
--inject_libraries : Allow injecting runtime libraries. | |
(default: true) | |
--polymer_pass : Equivalent to --polymer_version=1 | |
(default: false) | |
--process_closure_primitives : Processes built-ins from the Closure | |
library, such as goog.require(), | |
goog.provide(), and goog.exportSymbol( | |
). True by default. (default: true) | |
--rewrite_polyfills : Rewrite ES6 library calls to use | |
polyfills provided by the compiler's | |
runtime. (default: true) | |
Code Splitting: | |
--chunk (--module) VAL : A JavaScript chunk specification. The | |
format is <name>:<num-js-files>[:[<dep | |
>,...][:]]]. Chunk names must be | |
unique. Each dep is the name of a | |
chunk that this chunk depends on. | |
Chunks must be listed in dependency | |
order, and JS source files must be | |
listed in the corresponding order. | |
Where --chunk flags occur in relation | |
to --js flags is unimportant. | |
<num-js-files> may be set to 'auto' | |
for the first chunk if it has no | |
dependencies. Provide the value | |
'auto' to trigger chunk creation from | |
CommonJSmodules. | |
--chunk_output_path_prefix : Prefix for filenames of compiled JS | |
(--module_output_path_prefix) VAL chunks. <chunk-name>.js will be | |
appended to this prefix. Directories | |
will be created as needed. Use with | |
--chunk (default: ./) | |
--chunk_wrapper (--module_wrapper) VAL : An output wrapper for a JavaScript | |
chunk (optional). The format is | |
<name>:<wrapper>. The chunk name must | |
correspond with a chunk specified | |
using --chunk. The wrapper must | |
contain %s as the code placeholder. | |
Alternately, %output% can be used in | |
place of %s. %n% can be used to | |
represent a newline. The %basename% | |
placeholder can also be used to | |
substitute the base name of the chunk | |
output file. | |
Reports: | |
--create_source_map VAL : If specified, a source map file | |
mapping the generated source files | |
back to the original source file will | |
be output to the specified path. The | |
%outname% placeholder will expand to | |
the name of the output file that the | |
source map corresponds to. (default: ) | |
--output_chunk_dependencies : Prints out a JSON file of | |
(--output_module_dependencies) VAL dependencies between chunks. | |
(default: ) | |
--output_manifest VAL : Prints out a list of all the files in | |
the compilation. If --dependency_mode= | |
STRICT or LOOSE is specified, this | |
will not include files that got | |
dropped because they were not | |
required. The %outname% placeholder | |
expands to the JS output file. If | |
you're using modularization, using | |
%outname% will create a manifest for | |
each module. (default: ) | |
--property_renaming_report VAL : File where the serialized version of | |
the property renaming map produced | |
should be saved (default: ) | |
--source_map_include_content : Includes sources content into source | |
map. Greatly increases the size of | |
source maps but offers greater | |
portability (default: false) | |
--source_map_input VAL : Source map locations for input files, | |
separated by a '|', (i.e. | |
input-file-path|input-source-map) | |
--source_map_location_mapping VAL : Source map location mapping separated | |
by a '|' (i.e. filesystem-path|webserv | |
er-path) | |
--variable_renaming_report VAL : File where the serialized version of | |
the variable renaming map produced | |
should be saved (default: ) | |
Miscellaneous: | |
--charset VAL : Input and output charset for all | |
files. By default, we accept UTF-8 as | |
input and output US_ASCII (default: ) | |
--checks_only (--checks-only) : Don't generate output. Run checks, | |
but no optimization passes. (default: | |
false) | |
--define (--D, -D) VAL : Override the value of a variable | |
annotated @define. The format is | |
<name>[=<val>], where <name> is the | |
name of a @define variable and <val> | |
is a boolean, number, or a | |
single-quoted string that contains no | |
single quotes. If [=<val>] is | |
omitted, the variable is marked true | |
--help : Displays this message on stdout and | |
exit (default: true) | |
--third_party : Check source validity but do not | |
enforce Closure style rules and | |
conventions (default: false) | |
--use_types_for_optimization : Enable or disable the optimizations | |
based on available type information. | |
Inaccurate type annotations may | |
result in incorrect results. | |
(default: true) | |
--version : Prints the compiler version to stdout | |
and exit. (default: false) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment