mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
c5f2979a87
* entry_point attribute of nodejs_binary & rollup_bundle is now a label * nodejs rules 0.30.1 has new feature to symlink node_modules with yarn_install and bazel 0.26.0 includes new managed_directories feature which enables this * Symlinking of node_modules for yarn_install temporarily disabled (except for integration/bazel) until the fix for https://github.com/bazelbuild/bazel/issues/8487 makes it into a future bazel release. 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 #30965
58 lines
1.4 KiB
Python
58 lines
1.4 KiB
Python
load("//tools:defaults.bzl", "ng_module", "ng_package", "npm_package")
|
|
|
|
package(default_visibility = ["//packages/bazel/test:__subpackages__"])
|
|
|
|
ng_module(
|
|
name = "example",
|
|
srcs = glob(["*.ts"]),
|
|
module_name = "example",
|
|
deps = [
|
|
"//packages/bazel/test/ng_package/example/secondary",
|
|
"@npm//@types",
|
|
],
|
|
)
|
|
|
|
ng_package(
|
|
name = "npm_package",
|
|
srcs = [
|
|
"package.json",
|
|
"some-file.txt",
|
|
],
|
|
data = [
|
|
":arbitrary_bin_file",
|
|
":arbitrary_genfiles_file",
|
|
":extra-styles.css",
|
|
],
|
|
entry_point = ":index.ts",
|
|
entry_point_name = "waffels",
|
|
packages = [
|
|
":arbitrary_npm_package",
|
|
],
|
|
deps = [
|
|
":example",
|
|
"//packages/bazel/test/ng_package/example/secondary",
|
|
],
|
|
)
|
|
|
|
# Use a genrule to create a file in bazel-genfiles to ensure that the genfiles output of
|
|
# a rule can be passed through to the `data` of ng_package.
|
|
genrule(
|
|
name = "arbitrary_genfiles_file",
|
|
outs = ["arbitrary_genfiles.txt"],
|
|
cmd = "echo Hello > $@",
|
|
)
|
|
|
|
# Use a genrule to create a file in bazel-bin to ensure that the bin output of
|
|
# a rule can be passed through to the `data` of ng_package.
|
|
genrule(
|
|
name = "arbitrary_bin_file",
|
|
outs = ["arbitrary_bin.txt"],
|
|
cmd = "echo World > $@",
|
|
output_to_bindir = True,
|
|
)
|
|
|
|
npm_package(
|
|
name = "arbitrary_npm_package",
|
|
srcs = [":arbitrary-npm-package-main.js"],
|
|
)
|