From bef56ddf68671b2deba332866ec6b341fdc663ad Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Wed, 20 Aug 2025 11:49:09 +0200 Subject: [PATCH] dev build --- bb.edn | 2 +- build/src/scittle/build.clj | 5 ++++- shadow-cljs.edn | 43 +++++++++++++++++++++++++++++++------ 3 files changed, 41 insertions(+), 9 deletions(-) diff --git a/bb.edn b/bb.edn index bc4f02c..5545967 100644 --- a/bb.edn +++ b/bb.edn @@ -46,7 +46,7 @@ (fs/delete-tree "dist") (fs/create-dirs "dist") (run! (fn [f] (fs/copy f "dist")) - (fs/glob "resources/public/js" "*.js")))} + (fs/glob "resources/public/js" "*.{js,js.map}")))} bump-version {:doc "Bumps package.json and pushes new git tag" :task (do (shell "npm version patch") diff --git a/build/src/scittle/build.clj b/build/src/scittle/build.clj index 1e17a37..0998c4c 100644 --- a/build/src/scittle/build.clj +++ b/build/src/scittle/build.clj @@ -69,4 +69,7 @@ * :action - compile action, defaults to release, but may also be compile or watch" [{:keys [action args] :or {action "release"}}] - (build* (format "-M -m shadow.cljs.devtools.cli --force-spawn %s main %s" action (str/join " " args)))) + (build* (format "-M -m shadow.cljs.devtools.cli --force-spawn %s main %s" action (str/join " " args))) + (when (= "release" action) + (println "Also building dev release build") + (build* (format "-M -m shadow.cljs.devtools.cli --force-spawn %s dev %s" action (str/join " " args))))) diff --git a/shadow-cljs.edn b/shadow-cljs.edn index c542d3f..878dbd5 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -6,10 +6,7 @@ :builds {:main - {:compiler-options {:optimizations :simple - :pretty-print true - :pseudo-names true} - :target :browser + {:target :browser :js-options {:resolve {"react" {:target :global :global "React"} @@ -33,9 +30,41 @@ :depends-on #{:scittle.reagent :scittle}} :scittle.cljs-ajax {:entries [scittle.cljs-ajax] - :depends-on #{:scittle}} - :scittle.cljs-devtools {:entries [scittle.cljs-devtools] - :depends-on #{:scittle}}} + :depends-on #{:scittle}}} + :build-hooks [(shadow.cljs.build-report/hook)] + :output-dir "resources/public/js" + :devtools {:repl-pprint true}} + :dev + {:compiler-options {:optimizations :simple + :pretty-print true + :pseudo-names true} + :target :browser + :js-options + {:resolve {"react" {:target :global + :global "React"} + "react-dom" {:target :global + :global "ReactDOM"}}} + :modules + {:scittle.dev {:entries [scittle.core]} + :scittle.nrepl.dev {:entries [scittle.nrepl] + :depends-on #{:scittle.dev}} + :scittle.promesa.dev {:entries [scittle.promesa] + :depends-on #{:scittle.dev}} + :scittle.js-interop.dev {:entries [scittle.js-interop] + :depends-on #{:scittle.dev}} + :scittle.pprint.dev {:entries [scittle.pprint] + :depends-on #{:scittle.dev}} + :scittle.reagent.dev {:entries [scittle.reagent] + :depends-on #{:scittle.dev}} + :scittle.replicant.dev {:entries [scittle.replicant] + :depends-on #{:scittle.dev}} + :scittle.re-frame.dev {:entries [scittle.re-frame] + :depends-on #{:scittle.reagent.dev + :scittle.dev}} + :scittle.cljs-ajax.dev {:entries [scittle.cljs-ajax] + :depends-on #{:scittle.dev}} + :scittle.cljs-devtools.dev {:entries [scittle.cljs-devtools] + :depends-on #{:scittle.dev}}} :build-hooks [(shadow.cljs.build-report/hook)] :output-dir "resources/public/js" :devtools {:repl-pprint true}}}}