anki/ts/svelte/BUILD.bazel
Damien Elmes dbe5d43ba0 bundle all Svelte css into separate file
- svelte compilation outputs a separate .css file for each component
- compilation also adds an "import foo.css" to the top of each generated
.mjs file
- when the .mjs files are bundled into app.js, esbuild creates an app.css
as well
- graphs.scss was renamed to graphs_shared.scss and imported in the
top level GraphsPage. Henrik's style refactoring would be a better path
forward, but I needed to make this change for now, as the filenames were
conflicting.
2021-03-21 16:06:36 +10:00

28 lines
672 B
Python

load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary")
load("@npm//@bazel/typescript:index.bzl", "ts_library")
_deps = [
"@npm//@bazel/worker",
"@npm//sass",
"@npm//svelte",
"@npm//svelte-preprocess",
"@npm//svelte2tsx",
"@npm//typescript",
"@npm//@types/node",
]
ts_library(
name = "svelte_bin_ts",
srcs = ["svelte.ts"],
deps = _deps,
)
nodejs_binary(
name = "svelte_bin",
data = ["svelte_bin_ts"] + _deps,
entry_point = ":svelte.ts",
# should fix .js files being not found on subsequent worker requests
templated_args = ["--bazel_patch_module_resolver"],
visibility = ["//visibility:public"],
)