is there way to tell shadow to output exports using export ...
format instead of Object.defineProperty(module.exports, ...)
?
via https://clojureverse.org/t/generating-es-modules-browser-deno/6116 only
using :npm-module
target
can I use shadow-cljs to create an "uberjar" like node bundle? I want to compile something on one platform and transfer a single file or small archive to the target platform and have node it without any dependency issues
note to self: first try to read documentation: https://shadow-cljs.github.io/docs/UsersGuide.html#target-node-script
that doesn't bundle the dependency by default
you can use something like https://github.com/vercel/ncc to make it fully self contained
or even https://github.com/nexe/nexe
I'm trying to integrate flow-storm-debugger in my development workflow with shadow. It requires that you first call the flow-storm-debugger.main/-main and then connect using flow-storm-api/connect. I originally added a preload of a .cljs file but it needs to run the debugger in a clj context. Is there a way to execute that debugger.main namespace as part of my build?
I'm not using this workflow, would I need to switch? https://shadow-cljs.github.io/docs/UsersGuide.html#clj-run
sorry I don't have a clue what flow-storm is
weird, I used the release target and my single cljs dependency was bundled
oh sorry: node is on the target platform, but that's it. I don't need a single file executable, a single file script is enough for my usecase (arm7l system)
It's a debugger that I can connect to, but it requires a startup beforehand in clojure, and connecting to it when the app loads
Basically I want to run it beforehand, but I'm clojure, and then connect using a preload
then run the clj part however the instructions tell you
seems to be a separate application so you need to run it separately π
yes if you only use CLJS and the built-in node packages that'll be fine as is
but if you add any npm dependencies it'll either require the node_modules
folder wherever you are running or post-processing a release build with ncc
Hello! I just started using shadow-cljs (I used leiningen only)
{:source-paths ["src" "test"]
:dependencies [[com.taoensso/timbre "4.10.0"]
[macchiato/core "0.2.16"]]
:builds {:app {:devtools {:repl-init-ns backend.core
:repl-pprint true}
:main backend.core/server
:target :node-script
:source-map true
:exports {:server backend.core/server}
:output-dir "target"
:output-to "target/main.js"
:compiler-options {:optimizations :simple}}}
:nrepl {:init-ns backend.core}}
^ My edn file looks like this but where do I put development dependencies. Canβt see example from the official doc. I want to include [binaryage/devtools "1.0.2"]
:profiles {:dev {:source-paths ["dev"]
:repl-options {:init-ns user}
:dependencies [[midje "1.9.9"]
[ring/ring-mock "0.4.0"]]
:aliases {"test-ancient" "midje"
"upgrade-deps" ["ancient" "upgrade" ":all" ":check-clojure"]}
:bikeshed {:max-line-length 120
:docstrings false}}
^ Would using dev profile work? (This is from my leiningen project.clj
)just include it always. doesn't matter.
right, I want it integrated into the build, so trying with the clj-run option
That seemed to do it
@thheller Thank you. Just to clarify, do you mean I include it in :dependencies (top level)?
I was hoping there was a way to have preloads run clj files to execute so I could just do cider jack in from cider
@wontheone1 yes. it won't have any negative impacts.
Aha thank you. I guess some dead code elimination π makes sense
that doesn't apply. just adding a dependency does not automatically include it in a build. you actually need to require the namespaces it provides.