| # 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 = "b3521b29c7cb0c47a1a735cce7e7e811a4f80d8e3720cf3a1b624533e4bb7cb6", | |
| urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/2.3.2/rules_nodejs-2.3.2.tar.gz"], | |
| ) | |
| # Fetch sass rules for compiling sass files | |
| http_archive( | |
| name = "io_bazel_rules_sass", | |
| sha256 = "c78be58f5e0a29a04686b628cf54faaee0094322ae0ac99da5a8a8afca59a647", | |
| strip_prefix = "rules_sass-1.25.0", | |
| urls = [ | |
| "https://github.com/bazelbuild/rules_sass/archive/1.25.0.zip", | |
| "https://mirror.bazel.build/github.com/bazelbuild/rules_sass/archive/1.25.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", | |
| ) | |
| # Install the @angular/bazel package into @npm_angular_bazel | |
| # Note, this will probably break in a future rules_nodejs release. | |
| # It causes all builds to fetch npm packages even if not needed (eg. only building go code) | |
| load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") | |
| install_bazel_dependencies(suppress_warning = True) | |
| # Load @bazel/protractor dependencies | |
| load("@npm//@bazel/protractor:package.bzl", "npm_bazel_protractor_dependencies") | |
| npm_bazel_protractor_dependencies() | |
| # Load @bazel/karma dependencies | |
| load("@npm//@bazel/karma:package.bzl", "npm_bazel_karma_dependencies") | |
| npm_bazel_karma_dependencies() | |
| # 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 = "8c9728dc1bb3e8356b344088dfd10038984be74e1c8d6e92dbb05f21cabbb8e4", | |
| strip_prefix = "bazel-toolchains-3.7.1", | |
| urls = [ | |
| "https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/releases/download/3.7.1/bazel-toolchains-3.7.1.tar.gz", | |
| "https://github.com/bazelbuild/bazel-toolchains/releases/download/3.7.1/bazel-toolchains-3.7.1.tar.gz", | |
| ], | |
| ) |