File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 169169 :optimize-constants :output-dir :output-to :output-wrapper :parallel-build :preamble
170170 :pretty-print :print-input-delimiter :pseudo-names :recompile-dependents :source-map
171171 :source-map-inline :source-map-timestamp :static-fns :target :verbose :warnings
172- :emit-constants :ups-externs :ups-foreign-libs :ups-libs :warning-handlers })
172+ :emit-constants :ups-externs :ups-foreign-libs :ups-libs :warning-handlers :preloads })
173173
174174(def string->charset
175175 {" iso-8859-1" StandardCharsets/ISO_8859_1
13621362
13631363(declare foreign-deps-str add-header add-source-map-link )
13641364
1365+ (defn preloads [syms]
1366+ (letfn [(preload-str [sym]
1367+ (str " document.write('<script>goog.require(\" " (comp/munge sym) " \" );</script>');\n " ))]
1368+ (map preload-str syms)))
1369+
13651370(defn output-main-file [opts]
13661371 (let [asset-path (or (:asset-path opts)
13671372 (util/output-directory opts))
13851390 " if(typeof goog == \" undefined\" ) document.write('<script src=\" " asset-path " /goog/base.js\" ></script>');\n "
13861391 " document.write('<script src=\" " asset-path " /cljs_deps.js\" ></script>');\n "
13871392 " document.write('<script>if (typeof goog == \" undefined\" ) console.warn(\" ClojureScript could not load :main, did you forget to specify :asset-path?\" );</script>');\n "
1393+ (apply str (preloads (:preloads opts)))
13881394 " document.write('<script>goog.require(\" " (comp/munge (:main opts))" \" );</script>');\n " )))))
13891395
13901396(defn output-modules
You can’t perform that action at this time.
0 commit comments