Class Es6RewriteModulesToCommonJsModules

  • All Implemented Interfaces:
    CompilerPass

    public class Es6RewriteModulesToCommonJsModules
    extends java.lang.Object
    implements CompilerPass
    Rewrites an ES6 module to a CommonJS-like module for the sake of per-file transpilation + bunlding (e.g. Closure Bundler). Output is not meant to be type checked.
    • Constructor Detail

      • Es6RewriteModulesToCommonJsModules

        public Es6RewriteModulesToCommonJsModules​(AbstractCompiler compiler)
    • Method Detail

      • process

        public void process​(Node externs,
                            Node root)
        Description copied from interface: CompilerPass
        Process the JS with root node root. Can modify the contents of each Node tree
        Specified by:
        process in interface CompilerPass
        Parameters:
        externs - Top of external JS tree
        root - Top of JS tree