I'm having an issue with a module which only wants to be import and not require() - and I'm using :js-provider :external because I have a dependency with a dynamic import() that gcc doesn't want to know about.
My "obvious" answer would be to have :external have a flag to spit out import() in place of require() or even for shadow to detect that dynamically via the presence of only importhttps://github.com/konstaui/konsta/blob/02d6956439c8867331542f386b35ee43a2aaf4fa/package/package.json#L29.
But I honestly don't understand how this tower of JavaScript is delicately balanced and works in any way shape or form. Witchcraft.
you can set :external-index-format :esm so the external index uses import https://shadow-cljs.github.io/docs/UsersGuide.html#_js_tree_shaking
but if its using dynamic top-level imports it might cause issues due to its async nature. might need to go with :target :esm and :js-provider :import instead https://shadow-cljs.github.io/docs/UsersGuide.html#_third_party_tool_integration
:external is easier, so test that first
external with the esm format has worked an absolute treat, thank you!