1# Copyright 2020 The Pigweed Authors 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); you may not 4# use this file except in compliance with the License. You may obtain a copy of 5# the License at 6# 7# https://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12# License for the specific language governing permissions and limitations under 13# the License. 14 15package(default_visibility = ["//visibility:public"]) 16 17load("@npm//@bazel/typescript:index.bzl", "ts_library", "ts_devserver") 18load("//pw_web_ui:web_bundle.bzl", "web_bundle") 19 20ts_library( 21 name = "app_lib", 22 srcs = [ 23 "app.tsx", 24 "index.tsx", 25 ], 26 deps = [ 27 "@npm//@types/react", 28 "@npm//react", 29 "@npm//@types/react-dom", 30 "@npm//react-dom", 31 "@npm//@material-ui/core", 32 "//pw_web_ui/src/transport:web_serial_transport_lib", 33 ], 34) 35 36web_bundle( 37 name = "app_bundle", 38 deps = [ 39 ":app_lib", 40 ], 41 entry_point = "index.tsx", 42) 43 44ts_devserver( 45 # TODO(msoulanille): Use the devserver's bundler 46 # instead of serving the production bundle. 47 name = "devserver", 48 static_files = [ 49 "index.html", 50 ":app_bundle", 51 ] 52) 53 54ts_devserver( 55 # Bundles and serves the production bundle for testing. 56 # Should NOT be used for serving in production. 57 name = "prodserver", 58 static_files = [ 59 "index.html", 60 ":app_bundle", 61 ] 62) 63