This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-05
Channels
- # announcements (15)
- # aws (7)
- # babashka (105)
- # beginners (35)
- # biff (5)
- # calva (48)
- # cider (5)
- # clj-kondo (25)
- # cljdoc (14)
- # clojure (84)
- # clojure-czech (2)
- # clojure-dev (6)
- # clojure-europe (58)
- # clojure-nl (6)
- # clojure-norway (19)
- # clojure-portugal (2)
- # clojure-uk (5)
- # clojurescript (23)
- # cloverage (5)
- # code-reviews (5)
- # conjure (28)
- # data-science (1)
- # datomic (53)
- # events (6)
- # exercism (7)
- # fulcro (16)
- # graalvm-mobile (2)
- # honeysql (29)
- # improve-getting-started (2)
- # kaocha (32)
- # lambdaisland (2)
- # lsp (29)
- # malli (3)
- # overtone (1)
- # pedestal (8)
- # polylith (3)
- # portal (6)
- # quil (2)
- # rdf (15)
- # releases (2)
- # rewrite-clj (14)
- # sci (9)
- # shadow-cljs (7)
- # specter (5)
- # sql (5)
- # xtdb (38)
I'd like to include non-cljs files in my project (e.g. markdown (.md) and data (.dat)) that are copied as is from src. I found this but the files themselves are not copied into the target folder. Is it possible to configure non-cljs files to be watched and copied as raw text? https://clojureverse.org/t/best-practices-for-importing-raw-text-files-into-clojurescript-projects/2569
I think I know what Thomas will say since I've asked a similar question: No, and that is probably out of scope for shadow-cljs. But if you need to do this, you can accomplish it by just creating a script that manually starts the builds, and then also does the other file watching you require. You can do this by creating a script like: dev.clj:
(ns dev
(:require
[shadow.cljs.devtools.api :as shadow]))
(defn setup
{:shadow/requires-server true}
[]
;; Start your other watchers here, using libraries like juxt dirwatch
(shadow/watch :front))
Then just run
yarn shadow-cljs run dev/setup
Instead of shadow-cljs watch.I thought I was missing something because copying html is supported (on a file-by-file basis). Thank you for your suggestion!
I cobbled together a package.json
solution using
• https://www.npmjs.com/package/copy-and-watch
• https://www.npmjs.com/package/concurrently
Ok 👍. I did it the script way because I didn't want to inflict more process starting on my co-workers.
Your solution is definitely more elegant.
Hey is there a specific way to pull in this function as shown in the example: https://www.npmjs.com/package/copy-to-clipboard. I've tried ["copy-to-clipboard" :refer [copy]]
but I get the following error:
Uncaught TypeError: module$node_modules$copy_to_clipboard$index.copy is not a function
at eval (effects.cljs:66:5)
at re_frame$fx$do_fx_after (fx.cljc:59:23)
at Object.re_frame$interceptor$invoke_interceptor_fn [as invoke_interceptor_fn] (interceptor.cljc:70:6)
at Object.re_frame$interceptor$invoke_interceptors [as invoke_interceptors] (interceptor.cljc:108:24)
at Object.re_frame$interceptor$execute [as execute] (interceptor.cljc:201:8)
at Object.re_frame$events$handle [as handle] (events.cljc:65:14)
at Object.eval [as re_frame$router$IEventQueue$_process_1st_event_in_queue$arity$1] (router.cljc:179:10)
at Object.eval [as re_frame$router$IEventQueue$_run_queue$arity$1] (router.cljc:198:44)
at eval (router.cljc:146:64)
at Object.eval [as re_frame$router$IEventQueue$_fsm_trigger$arity$3]
I've also tried ["copy-to-clipboard" :as copy]
which seems more like what is shown in the example. But it doesn't seem to work and returns no errors.Ok, :as
does the trick.