porkostomus 2019-05-23T08:09:31.006900Z

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.


did you specify the -r flag


I mean include it

porkostomus 2019-05-23T08:14:01.008Z

I launched it with clojure -m figwheel.main --build cruel --repl


OK.. --repl is the same as -r

porkostomus 2019-05-23T08:15:10.009400Z

It works fine as long as I don't include the script I'm trying to load, which is the KLIPSE plugin


I’m not familiar with klipse. Sounds like it’s overwriting something it shouldn’t

porkostomus 2019-05-23T08:21:44.011600Z

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>
    &lt;script src="<>"&gt;&lt;/script&gt;

dominicm 2019-05-23T08:29:02.012700Z

Klipse might override clojurescript because of how it works, unsure though


I’m guessing you’ll have to include klipse as a dependency and use it in a more direct manner

porkostomus 2019-05-23T08:31:06.014400Z

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


kind of hacky though 🙂


ahh, ok

porkostomus 2019-05-23T08:33:59.016100Z

Thanks for the help. I thought I was doing something obviously wrong or something

porkostomus 2019-05-23T09:39:57.018200Z

Actually, the iframe idea works great!

practicalli-john 2019-05-23T17:26:12.025900Z

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.