Is it possible to split up WORKSPACE file in several files?

Viewed 482

I have a Bazel project with a WORKSPACE and many packages. WORKSPACE file is quite huge, so I wonder if it's possible to break it down in separated files and import them.

1 Answers

You can extract parts of the WORKSPACE into .bzl files, and load() these symbols for variables and functions into the WORKSPACE.

load("//foo/bar:file.bzl", "function_for_workspace")
function_for_workspace()

See Loading an extension for more information.

Related