public final class ProcessCommonJSModules extends Object implements CompilerPass
Constructor and Description |
---|
ProcessCommonJSModules(Compiler compiler,
ES6ModuleLoader loader)
Creates a new ProcessCommonJSModules instance which can be used to
rewrite CommonJS modules to a concatenable form.
|
ProcessCommonJSModules(Compiler compiler,
ES6ModuleLoader loader,
boolean reportDependencies)
Creates a new ProcessCommonJSModules instance which can be used to
rewrite CommonJS modules to a concatenable form.
|
Modifier and Type | Method and Description |
---|---|
void |
process(Node externs,
Node root)
Process the JS with root node root.
|
public ProcessCommonJSModules(Compiler compiler, ES6ModuleLoader loader)
compiler
- The compilerloader
- The module loader which is used to locate CommonJS modulespublic ProcessCommonJSModules(Compiler compiler, ES6ModuleLoader loader, boolean reportDependencies)
compiler
- The compilerloader
- The module loader which is used to locate CommonJS modulesreportDependencies
- Whether the rewriter should report dependency
information to the Closure dependency manager. This needs to be true
if we want to sort CommonJS module inputs correctly. Note that goog.provide
and goog.require calls will still be generated if this argument is
false.public void process(Node externs, Node root)
CompilerPass
process
in interface CompilerPass
externs
- Top of external JS treeroot
- Top of JS treeCopyright © 2009-2016 Google. All Rights Reserved.