Commit 27b6033 1 parent bd7ca5c commit 27b6033 Copy full SHA for 27b6033
File tree 7 files changed +59
-8
lines changed
7 files changed +59
-8
lines changed Original file line number Diff line number Diff line change
1
+ configure :
2
+ languages :
3
+ javascript : true
4
+ plugins :
5
+ - .aspect/cli/postcss.star
Original file line number Diff line number Diff line change
1
+ aspect .register_rule_kind ("sass_binary" , {
2
+ "From" : "//tools:sass.bzl" ,
3
+ "MergeableAttrs" : ["srcs" ],
4
+ "ResolveAttrs" : ["deps" ],
5
+ })
6
+
7
+ def declare_postcss (ctx ):
8
+ if len (ctx .sources ) == 0 :
9
+ ctx .targets .remove ("css" )
10
+ return
11
+
12
+ imports = []
13
+ for file in ctx .sources :
14
+ imports .extend ([
15
+ aspect .Import (
16
+ id = i .captures ["import" ],
17
+ provider = "js" ,
18
+ src = file .path ,
19
+ )
20
+ for i in file .query_results ["imports" ]
21
+ ])
22
+
23
+ ctx .targets .add (
24
+ name = "css" ,
25
+ kind = "sass_binary" ,
26
+ attrs = {
27
+ "srcs" : [src .path for src in ctx .sources ],
28
+ "deps" : imports ,
29
+ },
30
+ )
31
+
32
+ aspect .register_configure_extension (
33
+ id = "postcss" ,
34
+ prepare = lambda _ : aspect .PrepareResult (
35
+ sources = [
36
+ aspect .SourceExtensions (".scss" ),
37
+ ],
38
+ queries = {
39
+ "imports" : aspect .RegexQuery (
40
+ filter = "**/*.scss" ,
41
+ expression = """@use\\ s+['"](?P<import>[^'"]+)['"]""" ,
42
+ ),
43
+ },
44
+ ),
45
+ declare = declare_postcss ,
46
+ )
Original file line number Diff line number Diff line change 1
1
load ("@aspect_rules_ts//ts:defs.bzl" , "ts_config" )
2
2
load ("@npm//:defs.bzl" , "npm_link_all_packages" )
3
3
4
+ # aspect:js disabled
5
+ # aspect:generation_mode update
6
+
4
7
# Link npm packages
5
8
npm_link_all_packages (name = "node_modules" )
6
9
Original file line number Diff line number Diff line change 1
- load ("@aspect_bazel_lib//lib:directory_path.bzl" , "directory_path" )
2
1
load ("@aspect_bazel_lib//lib:copy_file.bzl" , "copy_file" )
2
+ load ("@aspect_bazel_lib//lib:directory_path.bzl" , "directory_path" )
3
3
load ("@npm//:defs.bzl" , "npm_link_all_packages" )
4
4
load ("//:defs.bzl" , "ng_application" )
5
5
Original file line number Diff line number Diff line change 1
- load ("@aspect_bazel_lib//lib:directory_path.bzl" , "directory_path" )
2
1
load ("@aspect_bazel_lib//lib:copy_file.bzl" , "copy_file" )
2
+ load ("@aspect_bazel_lib//lib:directory_path.bzl" , "directory_path" )
3
3
load ("@npm//:defs.bzl" , "npm_link_all_packages" )
4
4
load ("//:defs.bzl" , "ng_application" )
5
5
Original file line number Diff line number Diff line change 1
- load ("@rules_proto//proto:defs.bzl" , "proto_library" )
2
1
load ("@aspect_rules_ts//ts:proto.bzl" , "ts_proto_library" )
2
+ load ("@rules_proto//proto:defs.bzl" , "proto_library" )
3
3
4
4
package (default_visibility = ["//visibility:public" ])
5
5
Original file line number Diff line number Diff line change @@ -8,11 +8,8 @@ npm_link_all_packages(name = "node_modules")
8
8
9
9
sass_binary (
10
10
name = "css" ,
11
- srcs = glob (["src/**/*.scss" ]),
12
- deps = [
13
- "//:node_modules/@angular/cdk" ,
14
- "//:node_modules/@angular/material" ,
15
- ],
11
+ srcs = ["src/lib/lib-a.component.scss" ],
12
+ deps = ["//:node_modules/@angular/material" ],
16
13
)
17
14
18
15
ng_pkg (
You can’t perform that action at this time.
0 commit comments