anki/ts/compile_sass.bzl
Damien Elmes 372a28be29 rename workspace
I'd forgotten that Bazel "helpfully" adds __init__.py files into folders
that match the workspace name, breaking imports.
2021-07-10 23:58:53 +10:00

25 lines
670 B
Python

load("@io_bazel_rules_sass//:defs.bzl", "sass_binary")
def compile_sass(group, srcs, deps = [], visibility = ["//visibility:private"]):
css_files = []
for scss_file in srcs:
base = scss_file.replace(".scss", "")
name = base + "_sass"
css_file = base + ".css"
css_files.append(css_file)
sass_binary(
name = name,
src = scss_file,
sourcemap = False,
deps = deps,
visibility = visibility,
include_paths = ["external/ankidesktop"],
)
native.filegroup(
name = group,
srcs = css_files,
visibility = visibility,
)