mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00

I mourn the time lost trying to track this down :-( https://github.com/protobufjs/protobuf.js/issues/1014 We can't patch the minified file in dist without essentially duplicating it, so this change also switches from the external file to including the src file as part of the bundle.
90 lines
1.6 KiB
Text
90 lines
1.6 KiB
Text
load("@npm//@bazel/typescript:index.bzl", "ts_library")
|
|
load("//ts:prettier.bzl", "prettier_test")
|
|
load("//ts:eslint.bzl", "eslint_test")
|
|
load("//ts/svelte:svelte.bzl", "svelte", "svelte_check")
|
|
load("//ts:esbuild.bzl", "esbuild")
|
|
load("//ts:compile_sass.bzl", "compile_sass")
|
|
|
|
compile_sass(
|
|
srcs = ["congrats-base.scss"],
|
|
group = "base_css",
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
"//ts/sass:base_lib",
|
|
"//ts/sass:scrollbar_lib",
|
|
],
|
|
)
|
|
|
|
svelte(
|
|
name = "CongratsPage",
|
|
entry_point = "CongratsPage.svelte",
|
|
)
|
|
|
|
ts_library(
|
|
name = "index",
|
|
srcs = ["index.ts"],
|
|
deps = [
|
|
"CongratsPage",
|
|
"lib",
|
|
"//ts/lib",
|
|
"@npm//svelte",
|
|
"@npm//svelte2tsx",
|
|
],
|
|
)
|
|
|
|
ts_library(
|
|
name = "lib",
|
|
srcs = ["lib.ts"],
|
|
deps = [
|
|
"//ts/lib",
|
|
"//ts/lib:backend_proto",
|
|
],
|
|
)
|
|
|
|
esbuild(
|
|
name = "congrats",
|
|
args = [
|
|
"--global-name=anki",
|
|
"--resolve-extensions=.mjs,.js",
|
|
"--log-level=warning",
|
|
],
|
|
entry_point = "index.ts",
|
|
output_css = "congrats.css",
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
"CongratsPage",
|
|
":base_css",
|
|
":index",
|
|
"//ts/lib",
|
|
"//ts/lib:backend_proto",
|
|
"@npm//protobufjs",
|
|
],
|
|
)
|
|
|
|
exports_files(["congrats.html"])
|
|
|
|
# Tests
|
|
################
|
|
|
|
prettier_test(
|
|
name = "format_check",
|
|
srcs = glob([
|
|
"*.ts",
|
|
"*.svelte",
|
|
]),
|
|
)
|
|
|
|
eslint_test(
|
|
name = "eslint",
|
|
srcs = glob([
|
|
"*.ts",
|
|
]),
|
|
)
|
|
|
|
svelte_check(
|
|
name = "svelte_check",
|
|
srcs = glob([
|
|
"*.ts",
|
|
"*.svelte",
|
|
]),
|
|
)
|