|
| 1 | +load("//tools:defaults.bzl", "esbuild", "esbuild_config", "ng_module") |
| 2 | +load("@io_bazel_rules_sass//:defs.bzl", "npm_sass_library", "sass_binary") |
| 3 | +load("@build_bazel_rules_nodejs//:index.bzl", "copy_to_bin") |
| 4 | + |
| 5 | +package(default_visibility = ["//apps/code-of-conduct:__subpackages__"]) |
| 6 | + |
| 7 | +ng_module( |
| 8 | + name = "main", |
| 9 | + srcs = [ |
| 10 | + "environment.ts", |
| 11 | + "main.ts", |
| 12 | + ], |
| 13 | + deps = [ |
| 14 | + "//apps/code-of-conduct/app", |
| 15 | + "//apps/code-of-conduct/app:app_routes", |
| 16 | + "@npm//@angular/common", |
| 17 | + "@npm//@angular/compiler", |
| 18 | + "@npm//@angular/fire", |
| 19 | + "@npm//@angular/material", |
| 20 | + "@npm//@angular/platform-browser", |
| 21 | + "@npm//@angular/router", |
| 22 | + "@npm//zone.js", |
| 23 | + ], |
| 24 | +) |
| 25 | + |
| 26 | +npm_sass_library( |
| 27 | + name = "angular_material_sass_deps", |
| 28 | + deps = ["@npm//@angular/material"], |
| 29 | +) |
| 30 | + |
| 31 | +sass_binary( |
| 32 | + name = "styles", |
| 33 | + src = "styles.scss", |
| 34 | + include_paths = [ |
| 35 | + "external/npm/node_modules", |
| 36 | + ], |
| 37 | + deps = [ |
| 38 | + ":angular_material_sass_deps", |
| 39 | + ], |
| 40 | +) |
| 41 | + |
| 42 | +esbuild_config( |
| 43 | + name = "esbuild_config", |
| 44 | + config_file = "esbuild.config.mjs", |
| 45 | + deps = [ |
| 46 | + "//shared-scripts/angular-optimization:js_lib", |
| 47 | + "@npm//@angular/compiler-cli", |
| 48 | + ], |
| 49 | +) |
| 50 | + |
| 51 | +esbuild( |
| 52 | + name = "bundles", |
| 53 | + config = ":esbuild_config", |
| 54 | + entry_points = [":main.ts"], |
| 55 | + platform = "browser", |
| 56 | + target = "es2016", |
| 57 | + deps = [ |
| 58 | + ":main", |
| 59 | + ], |
| 60 | +) |
| 61 | + |
| 62 | +copy_to_bin( |
| 63 | + name = "application_files_in_bin", |
| 64 | + srcs = [ |
| 65 | + "favicon.ico", |
| 66 | + "index.html", |
| 67 | + "robots.txt", |
| 68 | + ], |
| 69 | +) |
| 70 | + |
| 71 | +filegroup( |
| 72 | + name = "application_files", |
| 73 | + srcs = [ |
| 74 | + ":application_files_in_bin", |
| 75 | + ":bundles", |
| 76 | + ":styles", |
| 77 | + "@npm//:node_modules/zone.js/dist/zone.js", |
| 78 | + ], |
| 79 | + visibility = ["//apps:__pkg__"], |
| 80 | +) |
0 commit comments