In JavaScript ES2015 modules default export name is munged to default$

Description

When using a foreign lib which is ES2015 module with default export, the value which is being exported is assigned to a property default on a namespace object. In ClojureScript code this means one should call to default var of that namespace. However in complied output of ClojureScript code the name default is getting munged to default$.

1 2 3 export default function inc(v) { return v + 1; }
1 2 3 4 (ns cljs-example.core (:require [lib.inc :as lib])) (lib/default 0)
1 2 3 goog.provide("module$lib$inc"); function inc$$module$lib$inc(v){return v+1} module$lib$inc.default=inc$$module$lib$inc
1 2 3 4 5 6 7 // Compiled by ClojureScript 1.8.40 {} goog.provide('cljs_example.core'); goog.require('cljs.core'); goog.require('module$lib$inc'); module$lib$inc.default$.call(null,(0)); //# sourceMappingURL=core.js.map

Environment

None

Status

Assignee

António Monteiro

Reporter

Roman Liutikov

Labels

Approval

Screened

Patch

Code and Test

Fix versions

Priority

Minor
Configure