@bazel/hide-bazel-files

中文文档
1.7.0发布于 2020/05/29Apache-2.0零依赖近 30 天下载 1.5万

A tool that hides all Bazel files in node_modules by prefixing them with an underscore

原始使用文档

@bazel/hide-bazel-files

This package is a workaround for an issue prior to Bazel 2.1. If you are on Bazel 2.1 or later, you should not need this, because the .bazelignore file contains node_modules so that Bazel doesn't try to read packages from this directory.

A tool to hide Bazel files that may be shipped with some npm packages. Packages with these files cause build failures when used with npm_install or yarn_install when used in Bazel 2.0 or earlier.

This tool renames all BUILD and BUILD.bazel files under node_modules to _BUILD and _BUILD.bazel respectively.

If you see an error such as

ERROR: /private/var/tmp/_bazel_greg/37b273501bbecefcf5ce4f3afcd7c47a/external/npm/BUILD.bazel:9:1: Label '@npm//:node_modules/rxjs/src/AsyncSubject.ts' crosses boundary of subpackage '@npm//node_modules/rxjs/src' (perhaps you meant to put the colon here: '@npm//node_modules/rxjs/src:AsyncSubject.ts'?)

then chances are there is an npm package in your dependencies that contains a BUILD file. To resolve this, add @bazel/hide-bazel-files to your devDependencies. The @bazel/hide-bazel-files npm package automatically runs a postinstall step that renames all Bazel build files in your node_modules.

"devDependencies": {
  "@bazel/hide-bazel-files": "latest"
},

Note: The commonly used npm package rxjs contains BUILD files from version 5.5.5 to 6.4.0 inclusive. These have now been removed in version 6.5.0. If you are using an rxjs version in that range and that is the only npm package in your dependencies that contains BUILD files then you can try upgrading to rxjs 6.4.0 instead of using hide-bazel-files.

版本与发布记录

@bazel/hide-bazel-files 共发布 38 个版本,首次发布于 2019/06/19;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.7.0latest2020/05/296 年前
1.6.12020/04/306 年前
1.6.02020/04/116 年前
1.5.02020/03/296 年前
1.4.12020/03/076 年前
1.4.02020/03/036 年前

关于 @bazel/hide-bazel-files 的常见问题

@bazel/hide-bazel-files 是什么?

A tool that hides all Bazel files in node_modules by prefixing them with an underscore

如何安装 @bazel/hide-bazel-files?

在项目目录运行 npm install @bazel/hide-bazel-files,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 hide-bazel-files,可以用 npx hide-bazel-files 直接运行。

@bazel/hide-bazel-files 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/bazel__hide-bazel-files 是否存在。

@bazel/hide-bazel-files 可以商用吗?

@bazel/hide-bazel-files 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@bazel/hide-bazel-files 的下载量有多少?

根据 npm 官方下载统计,@bazel/hide-bazel-files 在 2026/10/08 – 2026/11/06 这 30 天内被下载 15,423 次,日均约 514 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@bazel/hide-bazel-files 还在维护吗?

最新版本 1.7.0 发布于 2020/05/29(6 年前);至今共发布 38 个版本,其中过去 12 个月发布了 0 个;首次发布于 2019/06/19。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。