From 5193acb0a348c6a5e511d31d75b4d1ca82e2a95a Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Mon, 10 Jun 2019 11:35:03 -0700 Subject: [PATCH] build: set symlink_node_modules = False for yarn_install in main WORKSPACE and bazel schematics (#30627) This is needed to work-around issue: yarn_install & npm_install with managed directories can't handle deleted or manually regenerated node_modules folder [https://github.com/bazelbuild/rules_nodejs/issues/802] Underlying issue has been fixed in Bazel https://github.com/bazelbuild/bazel/issues/8487 but hasn't landed in a release yet PR Close #30627 --- WORKSPACE | 12 ++++++++++++ packages/bazel/src/builders/files/WORKSPACE.template | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/WORKSPACE b/WORKSPACE index 12282e82b5..eae6eb0b6c 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -65,7 +65,19 @@ node_repositories( yarn_install( name = "npm", + data = [ + "//:tools/npm/@angular_bazel/index.js", + "//:tools/npm/@angular_bazel/package.json", + "//:tools/postinstall-patches.js", + "//:tools/yarn/check-yarn.js", + ], package_json = "//:package.json", + # Don't install devDependencies, they are large and not used under Bazel + prod_only = True, + # Temporarily disable node_modules symlinking until the fix for + # https://github.com/bazelbuild/bazel/issues/8487 makes it into a + # future Bazel release + symlink_node_modules = False, yarn_lock = "//:yarn.lock", ) diff --git a/packages/bazel/src/builders/files/WORKSPACE.template b/packages/bazel/src/builders/files/WORKSPACE.template index ff5e14b07e..ce1bb868be 100644 --- a/packages/bazel/src/builders/files/WORKSPACE.template +++ b/packages/bazel/src/builders/files/WORKSPACE.template @@ -52,7 +52,12 @@ Try running `yarn bazel` instead. ) yarn_install( name = "npm", + data = ["//:angular-metadata.tsconfig.json"], package_json = "//:package.json", + # Temporarily disable node_modules symlinking until the fix for + # https://github.com/bazelbuild/bazel/issues/8487 makes it into a + # future Bazel release + symlink_node_modules = False, yarn_lock = "//:yarn.lock", )