File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 169
169
:optimize-constants :output-dir :output-to :output-wrapper :parallel-build :preamble
170
170
:pretty-print :print-input-delimiter :pseudo-names :recompile-dependents :source-map
171
171
: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 })
173
173
174
174
(def string->charset
175
175
{" iso-8859-1" StandardCharsets/ISO_8859_1
1362
1362
1363
1363
(declare foreign-deps-str add-header add-source-map-link )
1364
1364
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
+
1365
1370
(defn output-main-file [opts]
1366
1371
(let [asset-path (or (:asset-path opts)
1367
1372
(util/output-directory opts))
1385
1390
" if(typeof goog == \" undefined\" ) document.write('<script src=\" " asset-path " /goog/base.js\" ></script>');\n "
1386
1391
" document.write('<script src=\" " asset-path " /cljs_deps.js\" ></script>');\n "
1387
1392
" 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)))
1388
1394
" document.write('<script>goog.require(\" " (comp/munge (:main opts))" \" );</script>');\n " )))))
1389
1395
1390
1396
(defn output-modules
You can’t perform that action at this time.
0 commit comments