Fork me on GitHub
#shadow-cljs
<
2020-01-09
>
kenny03:01:01

Out of curiosity, if I have only one namespace that requires a npm module and namespace is never used, does shadow/closure know to not include the npm module?

thheller09:01:33

@kenny if the namespace is included then the npm module will be included as well. if the namespace is not required anywhere the npm module won't be either.

kenny15:01:37

In the first sentence, by “included” do you mean required?

kenny15:01:26

Ok, so the be clear, if I have this ns in my project

(ns my-ns
  (:require
    ["some-npm-module" :as module]))
And my-ns and "some-npm-module" are never required by any other ns, "some-npm-module" will not be included in the output?

kenny16:01:51

Great, thanks!

thheller09:01:19

included but not used makes no difference. there is no DCE for npm modules so if you don't use something don't include it