You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 4, 2025. It is now read-only.
Repository navigation
Commit b1f9e24
Browse filesBrowse the repository at this point in the historyBrowse files
If you're a full-stack developer, you might be using Bazel for your backend already.
25
+
In this case, you should install Bazel following instructions at http://bazel.build.
26
+
Also install `ibazel`, which is a watch mode for Bazel not included in the standard distribution. See https://github.com/bazelbuild/bazel-watcher#installation.
27
+
The `WORKSPACE` file has a `check_bazel_version` call which will print an error if your Bazel version is not in the supported range.
28
+
You simply run `bazel` commands shown below, and don't need to install NodeJS, yarn, or any other dependencies.
43
29
44
30
## Development
45
31
46
-
Next we'll run the development server:
32
+
First we'll run the development server:
47
33
48
34
```bash
49
35
$ yarn serve
36
+
# or
37
+
$ ibazel run //src:devserver
50
38
```
51
39
52
-
> This script runs `ibazel`, which is a "watch mode"
53
-
> for Bazel. That means it will watch any files that are inputs to the devserver,
54
-
> and when they change it will ask Bazel to re-build them. The server stays
55
-
> running, and when the re-build is finished, it will trigger the LiveReload in
56
-
> the browser.
40
+
This runs in "watch mode", which means it will watch any files that are inputs to the devserver, and when they change it will ask Bazel to re-build them.
41
+
When the re-build is finished, it will trigger a LiveReload in the browser.
57
42
58
43
This command prints a URL on the terminal. Open that page to see the demo app
59
44
running. Now you can edit one of the source files (`src/lib/file.ts` is an easy
60
45
one to understand and see the effect). As soon as you save a change, the app
61
46
should refresh in the browser with the new content. Our intent is that this time
62
47
is less than two seconds, even for a large application.
63
48
64
-
Control-C twice to kill the devserver and also stop `ibazel`.
49
+
Control-C twice to kill the devserver.
65
50
66
51
## Testing
67
52
68
53
We can also run all the unit tests:
69
54
70
55
```bash
71
56
$ yarn test
57
+
# or
58
+
$ bazel test //src/...
72
59
```
73
60
74
61
Or run the end-to-end tests:
75
62
76
63
```bash
77
64
$ yarn e2e
65
+
# or
66
+
$ bazel test //e2e/...
78
67
```
79
68
80
69
In this example, there is a unit test for the `hello-world` component which uses
@@ -92,6 +81,8 @@ bundlers can be integrated with Bazel.
0 commit comments