From 10b7ab2c6dfc5320176d0b478cb385418d6f1e52 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 20 Apr 2021 17:33:46 +1000 Subject: [PATCH] include sourcemaps for pages/* in dev builds --- qt/aqt/data/web/pages/BUILD.bazel | 3 +++ ts/copy.bzl | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/qt/aqt/data/web/pages/BUILD.bazel b/qt/aqt/data/web/pages/BUILD.bazel index 712025ad5..d0f347e01 100644 --- a/qt/aqt/data/web/pages/BUILD.bazel +++ b/qt/aqt/data/web/pages/BUILD.bazel @@ -14,6 +14,9 @@ _pages = [ name + ".html", name + ".js", ], + dev_srcs = [ + name + ".js.map", + ], package = "//ts/" + name, ) for name in _pages] diff --git a/ts/copy.bzl b/ts/copy.bzl index 67f4227ef..f8133ebc7 100644 --- a/ts/copy.bzl +++ b/ts/copy.bzl @@ -54,9 +54,9 @@ def copy_select_files(ctx, files, include, exclude, base, unwanted_prefix): return copy_files(ctx, wanted) -def copy_files_into_group(name, package, srcs): +def copy_files_into_group(name, package, srcs, dev_srcs = []): outs = [] - for src in srcs: + for src in srcs + dev_srcs: copy_file( name = src + "_copy", src = package + ":" + src, @@ -65,6 +65,9 @@ def copy_files_into_group(name, package, srcs): native.filegroup( name = name, - srcs = srcs, + srcs = srcs + select({ + "//:release": [], + "//conditions:default": dev_srcs, + }), visibility = ["//qt:__subpackages__"], )