Scittle dev (#127)
This commit is contained in:
parent
c57a5f9285
commit
cb968d06e3
8
bb.edn
8
bb.edn
|
@ -44,9 +44,11 @@
|
||||||
:depends [prod]
|
:depends [prod]
|
||||||
:task (do
|
:task (do
|
||||||
(fs/delete-tree "dist")
|
(fs/delete-tree "dist")
|
||||||
(fs/create-dirs "dist")
|
(fs/create-dirs "dist/dev")
|
||||||
(run! (fn [f] (fs/copy f "dist"))
|
(run! (fn [f] (fs/copy f "dist" {:replace-existing true}))
|
||||||
(fs/glob "resources/public/js" "*.js")))}
|
(fs/glob "resources/public/js" "*.{js,js.map}"))
|
||||||
|
(run! (fn [f] (fs/copy f "dist/dev" {:replace-existing true}))
|
||||||
|
(fs/glob "resources/public/js/dev" "*.{js,js.map}")))}
|
||||||
|
|
||||||
bump-version {:doc "Bumps package.json and pushes new git tag"
|
bump-version {:doc "Bumps package.json and pushes new git tag"
|
||||||
:task (do (shell "npm version patch")
|
:task (do (shell "npm version patch")
|
||||||
|
|
|
@ -69,4 +69,15 @@
|
||||||
* :action - compile action, defaults to release, but may also be compile or watch"
|
* :action - compile action, defaults to release, but may also be compile or watch"
|
||||||
[{:keys [action
|
[{:keys [action
|
||||||
args] :or {action "release"}}]
|
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 main %s %s"
|
||||||
|
action
|
||||||
|
"--config-merge '{:compiler-options {:optimizations :simple
|
||||||
|
:pretty-print true
|
||||||
|
:pseudo-names true}
|
||||||
|
:output-dir \"resources/public/js/dev\"
|
||||||
|
:modules {:scittle.cljs-devtools.dev {:entries [scittle.cljs-devtools]
|
||||||
|
:depends-on #{:scittle}}}}'"
|
||||||
|
(str/join " " args)))))
|
||||||
|
|
5
deps.edn
5
deps.edn
|
@ -1,7 +1,7 @@
|
||||||
{:paths ["src" "resources"]
|
{:paths ["src" "resources"]
|
||||||
:deps
|
:deps
|
||||||
{org.clojure/clojure {:mvn/version "1.11.1"}
|
{org.clojure/clojure {:mvn/version "1.11.1"}
|
||||||
thheller/shadow-cljs {:mvn/version "2.20.15"}
|
thheller/shadow-cljs {:mvn/version "3.1.8"}
|
||||||
org.babashka/sci {:git/url "https://github.com/babashka/sci"
|
org.babashka/sci {:git/url "https://github.com/babashka/sci"
|
||||||
:git/sha "9522bdadafcfbc5b86e3f37117df62634a9d923e"}
|
:git/sha "9522bdadafcfbc5b86e3f37117df62634a9d923e"}
|
||||||
#_{:local/root "../babashka/sci"}
|
#_{:local/root "../babashka/sci"}
|
||||||
|
@ -22,7 +22,8 @@
|
||||||
#_{:local/root "/Users/borkdude/dev/sci.configs"}
|
#_{:local/root "/Users/borkdude/dev/sci.configs"}
|
||||||
{:git/url "https://github.com/babashka/sci.configs"
|
{:git/url "https://github.com/babashka/sci.configs"
|
||||||
:git/sha "aa84a1b4f1fe45735e5b748769309fc842f737c1"
|
:git/sha "aa84a1b4f1fe45735e5b748769309fc842f737c1"
|
||||||
:exclusions [org.babashka/sci]}}
|
:exclusions [org.babashka/sci]}
|
||||||
|
binaryage/devtools {:mvn/version "1.0.7"}}
|
||||||
:aliases
|
:aliases
|
||||||
{:dev
|
{:dev
|
||||||
{:extra-paths ["dev"]
|
{:extra-paths ["dev"]
|
||||||
|
|
13
resources/public/index_text.html
Normal file
13
resources/public/index_text.html
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<script src="js/scittle.js" type="application/javascript"></script>
|
||||||
|
<script src="js/scittle.cljs-devtools.js" type="application/javascript"></script>
|
||||||
|
<script type="application/x-scittle">
|
||||||
|
(js/console.log {:a 1})
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -6,7 +6,11 @@
|
||||||
|
|
||||||
:builds
|
:builds
|
||||||
{:main
|
{:main
|
||||||
{:target :browser
|
{;; for dev build
|
||||||
|
#_#_:compiler-options {:optimizations :simple
|
||||||
|
:pretty-print true
|
||||||
|
:pseudo-names true}
|
||||||
|
:target :browser
|
||||||
:js-options
|
:js-options
|
||||||
{:resolve {"react" {:target :global
|
{:resolve {"react" {:target :global
|
||||||
:global "React"}
|
:global "React"}
|
||||||
|
@ -32,5 +36,5 @@
|
||||||
:scittle.cljs-ajax {:entries [scittle.cljs-ajax]
|
:scittle.cljs-ajax {:entries [scittle.cljs-ajax]
|
||||||
:depends-on #{:scittle}}}
|
:depends-on #{:scittle}}}
|
||||||
:build-hooks [(shadow.cljs.build-report/hook)]
|
:build-hooks [(shadow.cljs.build-report/hook)]
|
||||||
:output-dir "resources/public/js"
|
:output-dir "resources/public/js" ;; + "/dev" for dev build
|
||||||
:devtools {:repl-pprint true}}}}
|
:devtools {:repl-pprint true}}}}
|
||||||
|
|
6
src/scittle/cljs_devtools.cljs
Normal file
6
src/scittle/cljs_devtools.cljs
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
(ns scittle.cljs-devtools
|
||||||
|
(:require [devtools.core :as devtools]))
|
||||||
|
|
||||||
|
(devtools/set-pref! :disable-advanced-mode-check true)
|
||||||
|
|
||||||
|
(devtools/install!)
|
Loading…
Reference in a new issue