This repository has been archived by the owner on Feb 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
BUILD.bazel
78 lines (73 loc) · 2.33 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
load("//bazel:ts_project.bzl", "ts_project")
load("@npm//@bazel/rollup:index.bzl", "rollup_bundle")
load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary")
load("@npm//@bazel/terser:index.bzl", "terser_minified")
load("@npm//live-server:index.bzl", "live_server")
load("@io_bazel_rules_docker//container:image.bzl", "container_image")
package(default_visibility = ["//visibility:public"])
nodejs_binary(
name = "rollup_bin",
data = ["@npm//rollup"],
entry_point = "@npm//:node_modules/rollup/dist/bin/rollup",
templated_args = [
"--node_options=--max-old-space-size=7168",
],
)
rollup_bundle(
name = "bundle",
config_file = "rollup.config.js",
entry_point = "//src/frontend/app:index.js",
format = "iife",
output_dir = True,
rollup_bin = ":rollup_bin",
rollup_worker_bin = "//tools/rollup_worker",
sourcemap = "inline",
supports_workers = True,
deps = [
"//src/common/buildinfo",
"//src/frontend/app",
"@npm//@rollup/plugin-alias",
"@npm//@rollup/plugin-commonjs",
"@npm//@rollup/plugin-json",
"@npm//@rollup/plugin-node-resolve",
"@npm//@rollup/plugin-replace",
"@npm//react-native-web",
"@npm//rollup-plugin-node-polyfills",
"@npm//rollup-plugin-visualizer",
"@npm//@rollup/plugin-babel",
"@npm//@babel/preset-react",
"@npm//@babel/plugin-proposal-class-properties",
] + select({
"//src/frontend/app/ui:ui_kitten_config": [
"@npm//react-native-svg-web",
],
"//conditions:default": [],
}),
)
live_server(
name = "devserver",
data = [
"index-dev.html",
":bundle",
"@npm//:node_modules/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf",
],
tags = ["ibazel_notify_changes"],
templated_args = [
"./src/frontend/web",
"--port=8080",
"--no-browser",
"--wait=1000",
"--entry-file=index-dev.html",
"--mount=/bundle.js:src/frontend/web/bundle/bundle.js",
"--mount=/MaterialCommunityIcons.ttf:../npm/node_modules/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf",
],
)
container_image(
name = "web_image",
base = "@nginx//image",
directory = "/usr/share/nginx/html",
files = [
"index.html",
":bundle",
],
)