File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change
1
+ load ("@io_bazel_rules_sass//sass:sass.bzl" , "SassInfo" )
2
+
1
3
# Implementation of sass_bundle that performs an action
2
4
def _sass_bundle (ctx ):
3
5
# Define arguments that will be passed to the underlying nodejs script.
@@ -24,11 +26,15 @@ def _sass_bundle(ctx):
24
26
arguments = [args ],
25
27
)
26
28
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 ])
31
30
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
+ ]
32
38
33
39
# Rule definition for sass_bundle that defines attributes and outputs.
34
40
sass_bundle = rule (
You can’t perform that action at this time.
0 commit comments