File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 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+
13# Implementation of sass_bundle that performs an action
24def _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.
3440sass_bundle = rule (
You can’t perform that action at this time.
0 commit comments