I'm trying to compile a super simple es6 JS file as a foreign lib, as
described in the clojurescript docs under Bundling "Google Closure
Compatible
Code": https://clojurescript.org/reference/dependencies#bundling-javascript-code
The compilation succeeds with no optimizations. However, for the life of me
I can't get it to compile with advanced optimizations. I just get a bunch
of warnings, that say all the compiler phases were skipped. A lot of
warnings like:
WARNING: Skipping pass checkVariableReferences
factory features: [block function, getters, string continuation, trailing
comma, setters, ES3 keywor
ds as identifiers, reserved words as properties, RegExp flag 'y', array
pattern rest, binary literal,
let declaration, computed property, super, spread expression, RegExp flag
'u', default parameter, cl
ass, arrow function, generator, template literal, for-of loop, member
declaration, destructuring, oct
al literal, const declaration, extended object literal, rest parameter,
new.target, exponent operator
(**), trailing comma in param list, async function]
The JS file looks like:
goog.provide('js.lib');
js.lib.debugMessage = (x = "any old string") => {
console.log(`Printing ${x} from cljs!`);
};
The cljs file looks like:
(ns integrated.core
(:require [js.lib :as lib]))
(enable-console-print!)
(lib/debugMessage "Narf")
and using the standalone cljs.jar, my build.clj file is:
(require 'cljs.build.api)
(cljs.build.api/build "src"
{:main 'integrated.core
:output-to "out/main.js"
:language-in :es6
:foreign-libs [{:file "src"
:module-type :es6}]
:optimizations :advanced
:verbose true})
If this is not how it's done, how do folks get es6 js to load as a foreign
lib?
--
Note that posts from new members are moderated - please be patient with your
first post.
---
You received this message because you are subscribed to the Google Groups
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/clojurescript.