rules_closure icon indicating copy to clipboard operation
rules_closure copied to clipboard

When tests are compiled, sourceMappingUrl is not added to the resulting _bin.js file

Open applmak opened this issue 7 years ago • 1 comments

When I invoke closure_js_test like so:

closure_js_test(
    name = "sometest",
    entry_points = ...,
    srcs = ...,
    deps = ...,
    language = "ECMASCRIPT6_STRICT",
    defs = [
        "--jscomp_error=*",
        "--jscomp_off=analyzerChecks",
        "--dependency_mode=LOOSE"
    ],
)

the resulting _bin.js file doesn't contain

//# sourceMappingURL=sometest_bin.js.map

which would allow browsers to use the source map.

applmak avatar Mar 25 '17 15:03 applmak

Another very related issue is that the sourcemaps are generated with a / -> / base map, despite the phantomjs server actually serving from the runfiles directory, which requires file paths to be prepended with __main__. It would be neat to resolve this ambiguity between the source map and the actual test harness.

applmak avatar Apr 01 '17 00:04 applmak