Skip to content

Instantly share code, notes, and snippets.

@alexeagle
Created August 23, 2017 20:45
Show Gist options
  • Save alexeagle/4b491926aadbe59bbca9bfcc1cbd403a to your computer and use it in GitHub Desktop.
Save alexeagle/4b491926aadbe59bbca9bfcc1cbd403a to your computer and use it in GitHub Desktop.
# This loads a built-in from the @bazel_tools repository, letting us
# fetch more rules from github.
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
# We have to fetch the NodeJS support, since Angular tooling runs in node.
git_repository(
name = "build_bazel_rules_nodejs",
remote = "https://github.com/bazelbuild/rules_nodejs.git",
tag = "0.0.2",
)
# Now we load a rule that declares the location of our package.json file(s)
load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories")
node_repositories(package_json = ["//:package.json"])
# And we point to the TypeScript and Angular bazel rules, which we'll download
# from NPM using yarn or npm install.
local_repository(
name = "build_bazel_rules_typescript",
path = "node_modules/@bazel/typescript",
)
local_repository(
name = "angular",
path = "node_modules/@angular/bazel",
)
# There are Bazel rules for lots of other languages too!
# For example, we can install the Sass support:
git_repository(
name = "io_bazel_rules_sass",
remote = "https://github.com/bazelbuild/rules_sass.git",
tag = "0.0.2",
)
load("@io_bazel_rules_sass//sass:sass.bzl", "sass_repositories")
sass_repositories()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment