File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change 120
120
:gen-col 0
121
121
:gen-line 0 }))
122
122
123
- (defn append-source-map [state name source sb sm-data opts]
123
+ (defn prefix [s pre]
124
+ (str pre s))
125
+
126
+ (defn append-source-map
127
+ [state name source sb sm-data {:keys [output-dir asset-path] :as opts}]
124
128
(let [t (.valueOf (js/Date. ))
125
129
smn (if name
126
- (munge name)
130
+ (string/replace ( munge ( str name)) " . " " / " )
127
131
(str " cljs-" t))
128
- src (str smn " .cljs" )
129
- file (str smn " .js" )
132
+ ts (.valueOf (js/Date. ))
133
+ out (or output-dir asset-path)
134
+ src (cond-> (str smn " .cljs?rel=" ts)
135
+ out (prefix (str out " /" )))
136
+ file (cond-> (str smn " .js?rel=" ts)
137
+ out (prefix (str out " /" )))
130
138
json (sm/encode {src (:source-map sm-data)}
131
139
{:lines (+ (:gen-line sm-data) 3 )
132
- :file file :sources-content [source]})]
140
+ :file file :sources-content [source]})]
133
141
(when (:verbose opts) (debug-prn json))
134
142
(swap! state assoc-in
135
143
[:source-maps name] (sm/invert-reverse-map (:source-map sm-data)))
136
144
(.append sb
137
145
(str " \n //# sourceURL=" file
138
146
" \n //# sourceMappingURL=data:application/json;base64,"
139
- (base64/encodeString json true )))))
147
+ (base64/encodeString json)))))
140
148
141
149
; ; -----------------------------------------------------------------------------
142
150
; ; Analyze
You can’t perform that action at this time.
0 commit comments