Skip to content

Commit 71c205e

Browse files
devversionVivian Hu
authored and
Vivian Hu
committed
fix(bazel): theming bundle not exposed as sass_library (#14071)
* Expose the theming bundle as a `sass_library` that can be used to generate a custom theme with Bazel.
1 parent b4f44ed commit 71c205e

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tools/sass_bundle.bzl

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
load("@io_bazel_rules_sass//sass:sass.bzl", "SassInfo")
2+
13
# Implementation of sass_bundle that performs an action
24
def _sass_bundle(ctx):
35
# Define arguments that will be passed to the underlying nodejs script.
@@ -24,11 +26,15 @@ def _sass_bundle(ctx):
2426
arguments = [args],
2527
)
2628

27-
# The return value describes what the rule is producing.
28-
# In this case, we can use a `DefaultInfo`, since the rule only produces
29-
# a single output file.
30-
return [DefaultInfo(files = depset([ctx.outputs.output_name]))]
29+
output_depset = depset([ctx.outputs.output_name])
3130

31+
# The return value describes what the rule is producing. In this case we need to specify
32+
# the "DefaultInfo" and "SassInfo" provider so that the given rule target acts like a filegroup
33+
# and can be also used as sass_library.
34+
return [
35+
DefaultInfo(files = output_depset),
36+
SassInfo(transitive_sources = output_depset),
37+
]
3238

3339
# Rule definition for sass_bundle that defines attributes and outputs.
3440
sass_bundle = rule(

0 commit comments

Comments
 (0)