Skip to content

Commit

Permalink
build: set symlink_node_modules = False for yarn_install in main WORK…
Browse files Browse the repository at this point in the history
…SPACE and bazel schematics

This is needed to work-around issue: yarn_install & npm_install with managed directories can't handle deleted or manually regenerated node_modules folder [bazel-contrib/rules_nodejs#802]
Underlying issue has been fixed in Bazel bazelbuild/bazel#8487 but hasn't landed in a release yet
  • Loading branch information
gregmagolan committed Jun 10, 2019
1 parent 3fcdad5 commit d8e86a9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)

Expand Down
5 changes: 5 additions & 0 deletions packages/bazel/src/builders/files/WORKSPACE.template
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)

Expand Down

0 comments on commit d8e86a9

Please sign in to comment.