sourcegraph/client/web/scripts/BUILD.bazel
Quinn Slack 5cd8bf53a6
use swc instead of babel for faster bazel typescript transpilation (#57912)
swc is a very fast TypeScript transpiler.

Instead of using Babel for TypeScript transpilation in Bazel, we now use swc, which is much faster. We still use Babel in Jest (for tests), but in the future we intend to move away from Jest.

See https://docs.aspect.build/rulesets/aspect_rules_ts/docs/transpiler#swc-recommended for more information about using swc in Bazel, and https://swc.rs/ for general information about swc.
2023-11-02 22:49:03 -07:00

37 lines
1006 B
Python

load("//dev:defs.bzl", "ts_project")
load("@aspect_rules_js//js:defs.bzl", "js_test")
ts_project(
name = "scripts_lib",
srcs = [
"report-bundle-diff.ts",
],
tsconfig = "//client/web:tsconfig",
deps = [
"//:node_modules/@types/shelljs",
"//:node_modules/octokit",
"//:node_modules/shelljs",
],
)
js_test(
name = "report-bundle-diff_test",
data = [
":scripts_lib",
"//:node_modules/@statoscope/cli",
"//:node_modules/octokit",
"//:node_modules/shelljs",
"//client/web:bundle",
],
entry_point = "report-bundle-diff.js",
env = {
"BUILDKITE_COMMIT": "$$BUILDKITE_COMMIT",
"BUILDKITE_BRANCH": "$$BUILDKITE_BRANCH",
"BUILDKITE_PULL_REQUEST_REPO": "$$BUILDKITE_PULL_REQUEST_REPO",
"BUILDKITE_PULL_REQUEST": "$$BUILDKITE_PULL_REQUEST",
"GH_TOKEN": "$(GH_TOKEN)",
"WEB_BUNDLE_PATH": "$(rootpath //client/web:bundle)",
},
tags = ["manual"],
)