1f53301fd3
When migrating zone.js from gulp to bazel, some legacy build config files are still there, we have `rollup-es5.config.js` and `rollup-es5_global-es2015.config.js`, since in gulp build system, build `es5` or `esm` files are set in the config file, but in the bazel world, the output format is not config in the config.js file, but is required by the downstream bazel target. So we don't really need the two rollup config files any longer. Another difference is in `rollup-es5.config.js`, the `external` and `global` libraries names are also config there, and these settings are also valid for `es2015` build, these settings are not in the `es2015.config.js` for some legacy reasons. So we don't need to keep this difference either. PR Close #40481
80 lines
2.1 KiB
Python
80 lines
2.1 KiB
Python
load("//tools:defaults.bzl", "pkg_npm")
|
|
load("//packages/zone.js:bundles.bzl", "BUNDLES_ENTRY_POINTS")
|
|
load("//packages/zone.js:tools.bzl", "generate_rollup_bundle")
|
|
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
exports_files([
|
|
"tsconfig.json",
|
|
"rollup.config.js",
|
|
])
|
|
|
|
genrule(
|
|
name = "LICENSE_copy",
|
|
srcs = ["//:LICENSE"],
|
|
outs = ["LICENSE"],
|
|
cmd = "cp $< $@",
|
|
)
|
|
|
|
genrule(
|
|
name = "LICENSE_wrapped",
|
|
srcs = ["//:LICENSE"],
|
|
outs = ["LICENSE.wrapped"],
|
|
cmd = "(echo '/**\n @license' && cat $< && echo '*/') > $@",
|
|
)
|
|
|
|
# copy this file from //lib to //dist
|
|
genrule(
|
|
name = "zone_externs",
|
|
srcs = ["//packages/zone.js/lib:closure/zone_externs.js"],
|
|
outs = ["zone_externs.js"],
|
|
cmd = "cp $< $@",
|
|
)
|
|
|
|
genrule(
|
|
name = "zone_js_d_ts",
|
|
srcs = [
|
|
"//packages/zone.js/lib:zone_d_ts",
|
|
"//packages/zone.js/lib:zone.api.extensions.ts",
|
|
"//packages/zone.js/lib:zone.configurations.api.ts",
|
|
],
|
|
outs = ["zone.d.ts"],
|
|
cmd = "cat $(SRCS) > $@",
|
|
)
|
|
|
|
generate_rollup_bundle(
|
|
bundles = BUNDLES_ENTRY_POINTS,
|
|
)
|
|
|
|
pkg_npm(
|
|
name = "npm_package",
|
|
srcs = [
|
|
"CHANGELOG.md",
|
|
"README.md",
|
|
"package.json",
|
|
"//packages/zone.js/mix:package.json",
|
|
"//packages/zone.js/node:package.json",
|
|
"//packages/zone.js/testing:package.json",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":LICENSE.wrapped",
|
|
":LICENSE_copy",
|
|
":zone_externs",
|
|
"//packages/zone.js/dist:dist_bundle_group",
|
|
"//packages/zone.js/plugins:plugin_bundle_group",
|
|
] + [
|
|
"//packages/zone.js/bundles:" + b + "-es5.dist"
|
|
for b in BUNDLES_ENTRY_POINTS.keys()
|
|
] + [
|
|
"//packages/zone.js/bundles:" + b + "-es5.min.dist"
|
|
for b in BUNDLES_ENTRY_POINTS.keys()
|
|
] + [
|
|
"//packages/zone.js/fesm2015:" + b + "-es2015.dist"
|
|
for b in BUNDLES_ENTRY_POINTS.keys()
|
|
] + [
|
|
"//packages/zone.js/fesm2015:" + b + "-es2015.min.dist"
|
|
for b in BUNDLES_ENTRY_POINTS.keys()
|
|
] + [":zone_js_d_ts"],
|
|
)
|