Clojurians
#cljs-dev
<
2015-10-09
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

martinklepsch13:10:09

@dnolen: the cljs shim currently injects script tags with relative paths into the html without taking into account where the executing cljs file was loaded from. Do you think it’s worth making this work when loading the shim from a different location than where the shim is hosted? (i.e. shim and other cljs is hosted on localhost:4000 while the HTML file that loads it is hosted on localhost:3000)

martinklepsch13:10:13

if(typeof goog == "undefined") document.write('<script src="app.out/goog/base.js"></script>');
document.write('<script src="app.out/cljs_deps.js"></script>');

juhoteperi17:10:38

@martinklepsch: In IE it falls back to how it currently works?

martinklepsch17:10:10

@juhoteperi: that’s what I assume but haven’t tested

martinklepsch17:10:22

var base = document.currentScript.src.split("app.js")[0] || "";

dnolen17:10:33

@martinklepsch: what's the rationale here? serving different files from different ports just seems gratuitous

martinklepsch17:10:57

@dnolen: there's an existing application and in development it’s easier to serve cljs from another http server than integrating it into the existing app

dnolen17:10:26

@martinklepsch: :asset-path is usually an absolute path, why can’t you just set it to the full path?

martinklepsch18:10:40

@dnolen: you’re totally right, stupid mistake on my side. Should have checked the shim generating code first.

dnolen18:10:16

ha, not a stupid mistake, happy that :asset-path suffices :simple_smile: