Is there a standard way to use npm ES6 modules in clojurescript?

I honestly don’t know if this is possible in the core build tools nowadays.

shadow-cljs itself is a build tool. As such it provides many different features that the core build tools may or may not support. The language itself however is the same. The generic npm support is one of the key features of shadow-cljs and can do more than the default CLJS core tooling. One limitation of the core tools is that it currently (I believe) cannot load npm packages dynamically (eg. REPL). You may however load them as part of a regular build (eg. :target :bundle).

How come?

It is my philosophy that it is OK to add features to the build tooling without them being available in the core tools prior. A few features of shadow-cljs have made it into the code tools over time (eg. :modules) and I’m sure if someone were to work on adding “dynamic” npm support to the core tools that would get accepted.

2 Likes