Browse files

CLJS-683: :source-map-path option

Source map paths to source files can now be made relative to anything
making integration with web work flows simpler.
  • Loading branch information...
1 parent cc6a729 commit aceafe1edd719ae8f8dde9ece972f2c16ea2fd44 @swannodette swannodette committed Nov 17, 2013
Showing with 4 additions and 3 deletions.
  1. +1 −0 src/clj/cljs/closure.clj
  2. +3 −3 src/clj/cljs/source_map.clj
@@ -762,6 +762,7 @@
{:lines (+ (:lineCount sm-json) 2)
:file (:file sm-json)
:output-dir (output-directory opts)
+ :source-map-path (:source-map-path opts)
:relpaths relpaths}))))))
(report-failure result))))
@@ -152,13 +152,13 @@
[] cols)))
[] lines)))
-(defn relativize-path [path {:keys [output-dir relpaths]}]
+(defn relativize-path [path {:keys [output-dir source-map-path relpaths]}]
(re-find #"\.jar!/" path)
- (str output-dir (second (string/split path #"\.jar!")))
+ (str (or source-map-path output-dir) (second (string/split path #"\.jar!")))
- (str output-dir "/" (get relpaths path))))
+ (str (or source-map-path output-dir) "/" (get relpaths path))))
(defn encode
"Take an internal source map representation represented as nested

0 comments on commit aceafe1

Please sign in to comment.