@@ -8,9 +8,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
88# Add NodeJS rules
99http_archive (
1010 name = "build_bazel_rules_nodejs" ,
11- patches = ["//tools:multiple-node-versions.patch" ],
12- sha256 = "f7037c8e295fdc921f714962aee7c496110052511e2b14076bd8e2d46bc9819c" ,
13- urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.4.5/rules_nodejs-4.4.5.tar.gz" ],
11+ sha256 = "3ceb1e5b5dcad5fa2ad8870a20201cfbb9c9c63cac4055c9ab370034c765297f" ,
12+ urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.3.0/rules_nodejs-5.3.0.tar.gz" ],
1413)
1514
1615# Add sass rules
@@ -28,10 +27,10 @@ http_archive(
2827# for declaring Bazel build setting flags.
2928http_archive (
3029 name = "bazel_skylib" ,
31- sha256 = "191ea53b19b7e49b5b63d0ef81d1a6278227f9ac2c09fed1c2b3a75d573f1eeb " ,
32- strip_prefix = "bazel-skylib-b2ed61686ebca2a44d44857fef5b3e1d31cc2483 " ,
30+ sha256 = "a9c5d3a22461ed7063aa7b088f9c96fa0aaaa8b6984b601f84d705adc47d8a58 " ,
31+ strip_prefix = "bazel-skylib-8334f938c1574ef6f1f7a38a03550a31df65274e " ,
3332 urls = [
34- "https://github.com/bazelbuild/bazel-skylib/archive/b2ed61686ebca2a44d44857fef5b3e1d31cc2483 .tar.gz" ,
33+ "https://github.com/bazelbuild/bazel-skylib/archive/8334f938c1574ef6f1f7a38a03550a31df65274e .tar.gz" ,
3534 ],
3635)
3736
@@ -52,27 +51,42 @@ load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
5251
5352bazel_skylib_workspace ()
5453
55- load ("@build_bazel_rules_nodejs//:index .bzl" , "node_repositories" , "yarn_install " )
54+ load ("@build_bazel_rules_nodejs//:repositories .bzl" , "build_bazel_rules_nodejs_dependencies " )
5655
57- node_repositories (
58- # TOOD: Bring this in sync with CircleCI and nvmrc once we are on `rules_nodejs`#v5.
59- node_version = "16.10.0" ,
60- package_json = ["//:package.json" ],
56+ build_bazel_rules_nodejs_dependencies ()
57+
58+ load ("@rules_nodejs//nodejs:repositories.bzl" , "nodejs_register_toolchains" )
59+
60+ nodejs_register_toolchains (
61+ name = "nodejs" ,
62+ node_version = "16.14.0" ,
6163)
6264
65+ load ("@build_bazel_rules_nodejs//:index.bzl" , "yarn_install" )
6366load ("//tools:integration.bzl" , "create_npm_package_archive_build_file" )
6467
6568yarn_install (
6669 name = "npm" ,
6770 # We add the postinstall patches file here so that Yarn will rerun whenever
6871 # the file is modified.
6972 data = [
73+ "//:.yarn/releases/yarn-1.22.17.cjs" ,
74+ "//:.yarnrc" ,
7075 "//:tools/postinstall/apply-patches.js" ,
76+ "//:tools/postinstall/devmode-es2020-bazel.patch" ,
7177 ],
78+ # Currently disabled due to:
79+ # 1. Missing Windows support currently.
80+ # 2. Incompatibilites with the `ts_library` rule.
81+ exports_directories_only = False ,
7282 # Add archive targets for some NPM packages that are needed in integration tests.
7383 manual_build_file_contents = create_npm_package_archive_build_file (),
7484 package_json = "//:package.json" ,
7585 quiet = False ,
86+ # We prefer to symlink the `node_modules` to only maintain a single install.
87+ # See https://github.com/angular/dev-infra/pull/446#issuecomment-1059820287 for details.
88+ symlink_node_modules = True ,
89+ yarn = "//:.yarn/releases/yarn-1.22.17.cjs" ,
7690 yarn_lock = "//:yarn.lock" ,
7791)
7892
@@ -106,4 +120,6 @@ _dev_infra_browser_repositories()
106120
107121load ("@build_bazel_rules_nodejs//toolchains/esbuild:esbuild_repositories.bzl" , "esbuild_repositories" )
108122
109- esbuild_repositories ()
123+ esbuild_repositories (
124+ npm_repository = "npm" ,
125+ )
0 commit comments