Make prepack-dev work with js_bundle_genrule

Summary: Make prepack work with `js_bundle_genrule` by creating a nodejs_binary call that wraps the prepack CLI.

Reviewed By: davidaurelio

Differential Revision: D6107598

fbshipit-source-id: 6cf3992ecfdc3e15eeed648d341389f4415b79a6
This commit is contained in:
Chris Blappert 2017-10-25 11:27:48 -07:00 committed by Facebook Github Bot
parent a2c394535c
commit f021724714

13
DEFS Normal file
View File

@ -0,0 +1,13 @@
def create_prepack_dev_postprocessor(name, js_bundle, modelfile):
return js_bundle_genrule(
name = name,
js_bundle = js_bundle,
bash = r"""
set -e
$(exe //prepack:prepack-bundle-dev) {MODEL} --out "$OUT/$JS_BUNDLE_NAME" \
--srcmapIn "$SOURCEMAP" --srcmapOut "$SOURCEMAP_OUT" \
$JS_DIR/$JS_BUNDLE_NAME
""".format(MODEL = modelfile),
rewrite_sourcemap = True,
visibility = ["PUBLIC"],
)