Closed tosh closed 7 years ago
So in :optimizations none mode ClojureScript via google Closure has this behavior. If you are just getting strated with clojurescript I would try using lein cljsbuild
with :optimizations :simple and just use a manual reload style of development. You can hack how things are loaded but I don't think you want to go down that road, as its pretty dang complex.
I am currently converting a Greasemonkey script from JavaScript to ClojureScript and have trouble to get a fighweel setup going for development mode.
I tried to use the Greasemonkey JavaScript to insert a script tag that points to figwheel's output. That worked (e.g. for optimized output where figwheel puts everything into one file) but in development mode figwheel's JavaScript output uses
document.write
calls to add the script tags it needs.Since I do not control the backend of the websites I am working with I can only (asynchronously?) add a script tag to the page like this:
Unfortunately browsers then seem to block
document.write
calls inout.js
(this is a StackOverflow question I found that seemed related: https://stackoverflow.com/questions/32261556/how-to-load-third-party-javascript-tag-asynchronously-which-has-document-write) So I was wondering if figwheel needs thedocument.write
calls or if there would be another way?