Fork me on GitHub
#shadow-cljs
<
2021-03-03
>
Jason00:03:15

Is it possible to specify a path to shadow-cljs.edn in the command line?

lsenjov00:03:07

Workaround if not:

npx shadow-cljs --config-data "$(cat /path/to/shadow-cljs.edn)"

Jason00:03:22

I'm trying to sort out multiproject monorepo deps, so i am trying to start via chained namespaces and`clj`like :

clj -M:defaults:dev:ui -A:shadow-cljs watch app 
but I need to say which subproject's app build i mean and have all the paths work out.

3
Jason00:03:08

so I can't do it with npx

Jason01:03:28

Or can one add extra :source-paths per build?

thheller08:03:37

@jasonhlogic this is not possible. either put a separate shadow-cljs.edn into each project or use one at the root

thheller08:03:09

also separating depedencies per build is not something you need to do per build

thheller08:03:47

each build only uses whatever the build actually requires in the namespaces. you can have thousands of extra dependencies on the classpath, they won't matter as they won't be used.

šŸ‘ 3
denik22:03:56

@thheller Iā€™m exploring a system where frontend code is generated by the backend and would need to be compiled on the fly. All dependencies of that code would already exist on the frontend. One example is sending a react component as hiccup with handlers that call into frontend code. The backend sends:

'[:input {:type          "text"
          :default-value "foo"
          :on-change     (fn [e]
                           (frontend-ns.state/assoc-in id (.. e -target -value)))}]
which on the frontend should result in a CLJS hiccup vector where the function is a js function compiled from the CLJS counterpart.

šŸ˜² 3