We're updating the issue view to help you get more done. 

:source-map option to cljs.build.api/build should take nil

Description

It should be possible to specify nil or false when providing the :source-map option to cljs.build.api/build, for example, like this:

1 2 3 (build {... :optimizations :whitespace :source-map (when debug? "somepath.js.map")})

Currently that causes:

1 2 Exception in thread "main" java.lang.AssertionError: Assert failed: :source-map nil must specify a file in the same directory as :output-to "target/js/zs-background.js" if optimization setting applied (or (nil? (:output-to opts)) (:modules opts) (string? source-map)), compiling:(/Users/isaac/code/zensight/client/cljs/build.clj:66:1)

Using false has the same behavior. The alternative of conditionally assoc ing the key in works just fine, but is a tad awkward. It seems reasonably straightforward to fix - need to change that assert to check the value in the map and double-check that it's checked properly downstream. Happy to submit a patch if you'll take it.

Environment

None

Status

Assignee

David Nolen

Reporter

import

Labels

None

Approval

None

Patch

Code

Fix versions

Affects versions

1.7.48

Priority

Minor