| # The WORKSPACE file tells Bazel that this directory is a "workspace", which is like a project root. |
| # The content of this file specifies all the external dependencies Bazel needs to perform a build. |
| |
| #################################### |
| # ESModule imports (and TypeScript imports) can be absolute starting with the workspace name. |
| # The name of the workspace should match the npm package where we publish, so that these |
| # imports also make sense when referencing the published package. |
| workspace( |
| name = "examples_angular_view_engine", |
| managed_directories = {"@npm": ["node_modules"]}, |
| ) |
| |
| # These rules are built-into Bazel but we need to load them first to download more rules |
| load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| |
| # Fetch rules_nodejs so we can install our npm dependencies |
| http_archive( |
| name = "build_bazel_rules_nodejs", |
| sha256 = "f533eeefc8fe1ddfe93652ec50f82373d0c431f7faabd5e6323f6903195ef227", |
| urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/3.3.0/rules_nodejs-3.3.0.tar.gz"], |
| ) |
| |
| # Fetch sass rules for compiling sass files |
| http_archive( |
| name = "io_bazel_rules_sass", |
| patch_args = ["-p1"], |
| # We need the latest rules_sass to get the --bazel_patch_module_resolver behavior |
| # However it seems to have a bug, so we patch back to the prior dart-sass version. |
| # See https://github.com/bazelbuild/rules_sass/issues/127 |
| # TODO(alexeagle): fix upstream and remove patch |
| patches = ["@build_bazel_rules_nodejs//:rules_sass.issue127.patch"], |
| sha256 = "8392cf8910db2b1dc3b488ea18113bfe4fd666037bf8ec30d2a3f08fc602a6d8", |
| strip_prefix = "rules_sass-1.30.0", |
| urls = [ |
| "https://github.com/bazelbuild/rules_sass/archive/1.30.0.zip", |
| "https://mirror.bazel.build/github.com/bazelbuild/rules_sass/archive/1.30.0.zip", |
| ], |
| ) |
| |
| # Check the bazel version and download npm dependencies |
| load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") |
| |
| # Setup the Node.js toolchain & install our npm dependencies into @npm |
| yarn_install( |
| name = "npm", |
| package_json = "//:package.json", |
| yarn_lock = "//:yarn.lock", |
| ) |
| |
| # Load @bazel/protractor dependencies |
| load("@npm//@bazel/protractor:package.bzl", "npm_bazel_protractor_dependencies") |
| |
| npm_bazel_protractor_dependencies() |
| |
| # Load karma dependencies |
| http_archive( |
| name = "io_bazel_rules_webtesting", |
| sha256 = "9bb461d5ef08e850025480bab185fd269242d4e533bca75bfb748001ceb343c3", |
| urls = ["https://github.com/bazelbuild/rules_webtesting/releases/download/0.3.3/rules_webtesting.tar.gz"], |
| ) |
| |
| # Setup the rules_webtesting toolchain |
| load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories") |
| |
| web_test_repositories() |
| |
| load("@io_bazel_rules_webtesting//web/versioned:browsers-0.3.2.bzl", "browser_repositories") |
| |
| browser_repositories( |
| chromium = True, |
| firefox = True, |
| ) |
| |
| # Setup the rules_sass toolchain |
| load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories") |
| |
| sass_repositories() |
| |
| ################################ |
| # Support for Remote Execution # |
| ################################ |
| |
| http_archive( |
| name = "bazel_toolchains", |
| sha256 = "1adf5db506a7e3c465a26988514cfc3971af6d5b3c2218925cd6e71ee443fc3f", |
| strip_prefix = "bazel-toolchains-4.0.0", |
| urls = [ |
| "https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/releases/download/4.0.0/bazel-toolchains-4.0.0.tar.gz", |
| "https://github.com/bazelbuild/bazel-toolchains/releases/download/4.0.0/bazel-toolchains-4.0.0.tar.gz", |
| ], |
| ) |