Fork me on GitHub
#shadow-cljs
<
2021-07-10
>
lilactown01:07:04

is there a way for me to find how a namespace is being included in my bundle?

rberger05:07:42

Does shadow-cljs have a way to check for unused dependencies in package.json for a clojurescript project like npm/yarn https://github.com/depcheck/depcheck does for JS projects? Or is there some combination of tooling that could accomplish that?

thheller06:07:51

@rberger not built in but I guess you can do npx shadow-cljs compile app --config-merge '{:js-options {:js-provider :external :external-index "foo.js"}}' and then let the regular depcheck run over that foo.js file

thheller06:07:18

that file will require all npm deps you'd otherwise include in a format depcheck should understand

rberger07:07:27

Cool. I was also able to review the build report and manually figure it out

lilactown16:07:56

another q: what's the way to tell shadow-cljs pull in the profiling version of React when doing a release build? https://gist.github.com/bvaughn/25e6233aeb1b4f0cdb8d8366e54a3977

thheller16:07:47

:js-options {:resolve {"react-dom" {:target :npm :require "react-dom/profiling"}}}, optionally wrapped in :release {:js-options ...} when it should only apply to release builds?

thheller16:07:25

or the same via --config-merge

lilactown16:07:44

the --config-merge would allow me to do this via CLI

lilactown16:07:26

could I elide the :release {,,,} wrapping if I'm doing shadow-cljs release --config-merge ",,,"?

thheller16:07:23

of course. whatever you merge will only apply to the build you are doing at that time.

lilactown16:07:27

that worked 🙂 appreciate it!