Welcome! Please see the About page for a little more info on how this works.

0 votes
in ClojureScript by
having simple file like this

export const simpleString = "abcdefg";

then importing it in :foreign-libs like this
{:file "generated/test.js"
                 :provides ["testNs"]
                 :module-type :es6}

produces file that exports nothing and the namespace is empty map. The reason seems to be that the namespace var is declared second time and gets shadowed. The generated file looks like this:

goog.provide("module$Users$gdanov$work$playground$trading_cockpit$generated$test");
var module$Users$gdanov$work$playground$trading_cockpit$generated$test={"default":{}};module$Users$gdanov$work$playground$trading_cockpit$generated$test["default"].simpleString="abcdefg"

the only option that is not vanilla in the clojurescript compiler config is this
:package-json-resolution :nodejs
:target               :nodejs

optimizations set to :none

1 Answer

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJS-3040 (reported by alex+import)
...