mirror of
https://github.com/logseq/logseq.git
synced 2026-04-30 08:56:29 +00:00
monorepo
This commit is contained in:
31
web/dev/shadow/hooks.clj
Normal file
31
web/dev/shadow/hooks.clj
Normal file
@@ -0,0 +1,31 @@
|
||||
(ns shadow.hooks
|
||||
(:require [clojure.java.shell :refer [sh]]
|
||||
[clojure.string :as str]))
|
||||
|
||||
;; copied from https://gist.github.com/mhuebert/ba885b5e4f07923e21d1dc4642e2f182
|
||||
(defn exec [& cmd]
|
||||
(let [cmd (str/split (str/join " " (flatten cmd)) #"\s+")
|
||||
_ (println (str/join " " cmd))
|
||||
{:keys [exit out err]} (apply sh cmd)]
|
||||
(if (zero? exit)
|
||||
(when-not (str/blank? out)
|
||||
(println out))
|
||||
(println err))))
|
||||
|
||||
(defn purge-css
|
||||
{:shadow.build/stage :flush}
|
||||
[state {:keys [css-source
|
||||
js-globs
|
||||
public-dir]}]
|
||||
(case (:shadow.build/mode state)
|
||||
:release
|
||||
(exec "purgecss --css " css-source
|
||||
(for [content (if (string? js-globs) [js-globs] js-globs)]
|
||||
(str "--content " content))
|
||||
"-o" public-dir)
|
||||
|
||||
:dev
|
||||
(do
|
||||
(exec "mkdir -p" public-dir)
|
||||
(exec "cp" css-source (str public-dir "/" (last (str/split css-source #"/"))))))
|
||||
state)
|
||||
7
web/dev/shadow/user.clj
Normal file
7
web/dev/shadow/user.clj
Normal file
@@ -0,0 +1,7 @@
|
||||
(ns shadow.user
|
||||
(:require [shadow.cljs.devtools.api :as api]))
|
||||
|
||||
(defn cljs-repl
|
||||
[]
|
||||
(api/watch :app)
|
||||
(api/repl :app))
|
||||
Reference in New Issue
Block a user