This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-23
Channels
- # announcements (12)
- # beginners (225)
- # calva (7)
- # cider (45)
- # clj-kondo (1)
- # cljdoc (1)
- # cljsrn (3)
- # clojure (112)
- # clojure-dev (45)
- # clojure-europe (6)
- # clojure-finland (2)
- # clojure-india (1)
- # clojure-nl (27)
- # clojure-spec (37)
- # clojure-uk (171)
- # clojurescript (39)
- # core-async (9)
- # cursive (22)
- # datascript (8)
- # datomic (50)
- # emacs (12)
- # figwheel-main (17)
- # fulcro (42)
- # garden (2)
- # hoplon (27)
- # jobs (4)
- # kaocha (8)
- # klipse (2)
- # luminus (2)
- # off-topic (9)
- # perun (33)
- # planck (2)
- # re-frame (9)
- # reagent (48)
- # reitit (5)
- # remote-jobs (1)
- # rum (2)
- # shadow-cljs (23)
- # slack-help (3)
- # spacemacs (18)
- # sql (7)
- # tools-deps (24)
- # unrepl (9)
- # vim (30)
Hi, I'm not new to Clojure but fairly new to web development so I feel a bit silly asking this because I'm trying to do something simple and can't figure it out. I went through the tutorial and set up my custom index.html page, at the bottom of which I want to load a script. But when I put it there, it loads the page right but I don't get the REPL. There must be something really basic that I'm not getting.
I launched it with clojure -m figwheel.main --build cruel --repl
It works fine as long as I don't include the script I'm trying to load, which is the KLIPSE plugin
the bottom of my file looks like this
<div id="app"></div>
<!-- this refers to target/public/cljs-out/main.js -->
<script src="cljs-out/cruel-main.js"></script>
<script src=""></script>
</body>
</html>
I’m guessing you’ll have to include klipse
as a dependency and use it in a more direct manner
I suppose that could be. There are instructions on how to host it locally, perhaps I'll try that.
or actually.. You could just give it a sandbox by including it in another html-file and use an iframe
Thanks for the help. I thought I was doing something obviously wrong or something
I wanted to create a single javascript file for deployment in a specific directory, without affecting the dev build. So I created a live.cljs.edn
file (copied dev.cljs.edn) and added :output-to
with the new path
^{:watch-dirs ["test" "src"]
:css-dirs ["resources/public/css"]
:auto-testing true}
{:main practicalli-landing-page.core
:output-to "docs/cljs-out/main.js"}
I then created a new alias in the project.clj
file that calls this build
"fig:live" ["run" "-m" "figwheel.main" "-O" "advanced" "-bo" "live"]
It all seems to work, just checking if I am doing this correctly, or if there is a recommended way.
For background, the project was created with Leiningen figwheel-main template and deployment is on GitHub pages along with a static index.html file. I use the /docs
folder to serve the static files from via GitHub pages.