                     [AbstractCompiler])))
  (def can-convert-amd? true)
  (def can-convert-amd? false))
+
+(compile-if
+ (and (.getConstructor ProcessEs6Modules
+        (into-array java.lang.Class
+                    [com.google.javascript.jscomp.Compiler ES6ModuleLoader Boolean/TYPE]))
+      (.getConstructor ES6ModuleLoader
+        (into-array java.lang.Class
+                    [AbstractCompiler java.lang.String])))
+ (def can-convert-es6? true)
+ (def can-convert-es6? false))
+
 
 ;; Closure API
 ;; ===========

  (defmethod convert-js-module :commonjs [js]
    (let [js-file (:file js)
          path (.getParent (io/file js-file))
          module-root (cond->> path
                        (.startsWith path File/separator) (str ".")
                        (not (.startsWith path (str "." File/separator))) (str "." File/separator)
                        (not (.endsWith path File/separator)) (#(str % File/separator)))
          ^List externs '()
          ^SourceFile source-file (js-source-file js-file (slurp js-file))
          ^CompilerOptions options (CompilerOptions.)
          closure-compiler (doto (make-closure-compiler)
                             (.init externs [source-file] options))
          es6-loader (ES6ModuleLoader. closure-compiler module-root)
          cjs (ProcessCommonJSModules. closure-compiler es6-loader)
          ^Node root (.parse closure-compiler source-file)]
      (compile-if can-convert-amd?
        (.process (TransformAMDToCJSModule. closure-compiler) nil root))
      (.process cjs nil root)
      (.toSource closure-compiler root))))

(defmethod convert-js-module :default [js]

              Result JSError CheckLevel DiagnosticGroups
              CommandLineRunner AnonymousFunctionNamingPolicy
              JSModule JSModuleGraph SourceMap ProcessCommonJSModules
              ES6ModuleLoader AbstractCompiler TransformAMDToCJSModule
              ProcessEs6Modules]
           [com.google.javascript.rhino Node]
           [java.security MessageDigest]
           [javax.xml.bind DatatypeConverter]
