From 5a0e23bcbf673ea507bdfb2270ad259cba4f4e45 Mon Sep 17 00:00:00 2001 From: Paul Wankadia Date: Fri, 30 Jun 2023 13:48:14 +0000 Subject: [PATCH] Simplify the app build a little. Change-Id: I16bf812f5e01a3098d0644298f606970d7e7321a Reviewed-on: https://code-review.googlesource.com/c/re2/+/61470 Reviewed-by: Paul Wankadia Reviewed-by: Alex Chernyakhovsky --- app/BUILD.bazel | 1 + app/build.sh | 8 +------- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/app/BUILD.bazel b/app/BUILD.bazel index 01ff8d429..50e7e2c92 100644 --- a/app/BUILD.bazel +++ b/app/BUILD.bazel @@ -10,6 +10,7 @@ cc_binary( linkopts = [ "--bind", "-sENVIRONMENT=web", + "-sSINGLE_FILE=1", "-sMODULARIZE=1", "-sEXPORT_ES6=1", "-sEXPORT_NAME=loadModule", diff --git a/app/build.sh b/app/build.sh index c272bf5ac..a606d7bec 100755 --- a/app/build.sh +++ b/app/build.sh @@ -25,13 +25,7 @@ else ${BAZEL} build --compilation_mode=opt \ --copt=-fno-stack-protector \ -- :all - # Bazel doesn't retain the `_re2.wasm` artifact; - # we have to redo the link command to obtain it. - pushd .. - emcc @bazel-bin/app/_re2.js-2.params - cd bazel-bin/app - cp _re2.js _re2.wasm ${DSTDIR} - popd + cp ../bazel-bin/app/_re2.js ${DSTDIR} # Clean up the sundry Bazel output directories. ${BAZEL} clean --expunge cp app.ts index.html _re2.d.ts ${DSTDIR}