anki/ts/esbuild.bzl
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

17 lines
558 B
Python

load("//ts/esbuild:upstream.bzl", _esbuild = "esbuild_macro")
def esbuild(name, **kwargs):
_esbuild(
name = name,
tool = select({
"@bazel_tools//src/conditions:darwin": "@esbuild_darwin//:bin/esbuild",
"@bazel_tools//src/conditions:windows": "@esbuild_windows//:esbuild.exe",
"@bazel_tools//src/conditions:linux_x86_64": "@esbuild_linux//:bin/esbuild",
}),
minify = select({
"//:release": True,
"//conditions:default": False,
}),
**kwargs
)