2019-08-15 11:35:33 -04:00
|
|
|
load("//tools:defaults.bzl", "rollup_bundle")
|
2019-05-31 11:56:07 -04:00
|
|
|
load("//packages/zone.js:bundles.bzl", "ES2015_BUNDLES", "ES5_BUNDLES", "ES5_GLOBAL_BUNDLES")
|
|
|
|
|
2019-10-05 23:06:53 -04:00
|
|
|
package(default_visibility = ["//visibility:public"])
|
2019-05-31 11:56:07 -04:00
|
|
|
|
|
|
|
# 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_d_ts",
|
2019-10-05 23:06:53 -04:00
|
|
|
srcs = ["//packages/zone.js/lib:zone_d_ts"],
|
2019-05-31 11:56:07 -04:00
|
|
|
outs = ["zone.js.d.ts"],
|
2019-10-05 23:06:53 -04:00
|
|
|
cmd = "cp $< $@",
|
2019-05-31 11:56:07 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
[
|
|
|
|
rollup_bundle(
|
|
|
|
name = b[0].replace("-", "_") + "_rollup",
|
2019-10-27 19:28:03 -04:00
|
|
|
config_file = "//packages/zone.js:rollup-es5.config.js",
|
2019-05-31 11:56:07 -04:00
|
|
|
entry_point = b[1] + ".ts",
|
|
|
|
deps = [
|
|
|
|
"//packages/zone.js/lib",
|
2019-10-27 19:28:03 -04:00
|
|
|
"@npm//rollup-plugin-commonjs",
|
|
|
|
"@npm//rollup-plugin-node-resolve",
|
2019-05-31 11:56:07 -04:00
|
|
|
],
|
|
|
|
)
|
|
|
|
for b in ES5_BUNDLES.items()
|
|
|
|
]
|
|
|
|
|
|
|
|
[
|
|
|
|
rollup_bundle(
|
|
|
|
name = b[0].replace("-", "_") + "_rollup",
|
2019-10-27 19:28:03 -04:00
|
|
|
config_file = "//packages/zone.js:rollup-es5_global-es2015.config.js",
|
2019-05-31 11:56:07 -04:00
|
|
|
entry_point = b[1] + ".ts",
|
|
|
|
deps = [
|
|
|
|
"//packages/zone.js/lib",
|
2019-10-27 19:28:03 -04:00
|
|
|
"@npm//rollup-plugin-commonjs",
|
|
|
|
"@npm//rollup-plugin-node-resolve",
|
2019-05-31 11:56:07 -04:00
|
|
|
],
|
|
|
|
)
|
|
|
|
for b in ES5_GLOBAL_BUNDLES.items() + ES2015_BUNDLES.items()
|
|
|
|
]
|
|
|
|
|
|
|
|
# Extract and rename each es5 bundle to a .js and .min.js in the dist/ dir
|
|
|
|
[
|
|
|
|
genrule(
|
|
|
|
name = b[0] + "-dist",
|
|
|
|
srcs = [
|
2019-10-27 19:28:03 -04:00
|
|
|
b[0].replace("-", "_") + "_rollup.es5umd.js",
|
|
|
|
b[0].replace("-", "_") + "_rollup.min.es5umd.js",
|
2019-05-31 11:56:07 -04:00
|
|
|
],
|
|
|
|
outs = [
|
|
|
|
b[0] + ".js",
|
|
|
|
b[0] + ".min.js",
|
|
|
|
],
|
|
|
|
cmd = " && ".join([
|
|
|
|
"mkdir -p $(@D)",
|
2019-07-29 19:07:43 -04:00
|
|
|
# remove the last line '//# sourceMappingURL=b[0].umd.js.map' because we don't release
|
|
|
|
# source map for now
|
2019-07-29 09:01:13 -04:00
|
|
|
"sed '$$d' $(@D)/" + b[0].replace("-", "_") + "_rollup.es5umd.js > $(@D)/" + b[0] + ".js",
|
2019-05-31 11:56:07 -04:00
|
|
|
"cp $(@D)/" + b[0].replace("-", "_") + "_rollup.min.es5umd.js $(@D)/" + b[0] + ".min.js",
|
|
|
|
]),
|
|
|
|
)
|
|
|
|
for b in ES5_BUNDLES.items() + ES5_GLOBAL_BUNDLES.items()
|
|
|
|
]
|
|
|
|
|
|
|
|
# Extract and rename each es5 bundle to a .js and .min.js in the dist/ dir
|
|
|
|
[
|
|
|
|
genrule(
|
|
|
|
name = b[0] + "-dist-dev-test",
|
|
|
|
srcs = [
|
2019-10-27 19:28:03 -04:00
|
|
|
b[0].replace("-", "_") + "_rollup.es5umd.js",
|
2019-05-31 11:56:07 -04:00
|
|
|
],
|
|
|
|
outs = [
|
|
|
|
b[0] + ".dev.test.js",
|
|
|
|
],
|
|
|
|
cmd = " && ".join([
|
|
|
|
"mkdir -p $(@D)",
|
|
|
|
"cp $(@D)/" + b[0].replace("-", "_") + "_rollup.es5umd.js $(@D)/" + b[0] + ".dev.test.js",
|
|
|
|
]),
|
|
|
|
)
|
|
|
|
for b in ES5_BUNDLES.items() + ES5_GLOBAL_BUNDLES.items()
|
|
|
|
]
|
|
|
|
|
|
|
|
[
|
|
|
|
genrule(
|
|
|
|
name = b + "-dist-dev-test",
|
|
|
|
srcs = [
|
2019-10-27 19:28:03 -04:00
|
|
|
b.replace("-", "_") + "_rollup.umd.js",
|
2019-05-31 11:56:07 -04:00
|
|
|
],
|
|
|
|
outs = [
|
|
|
|
b + ".dev.test.js",
|
|
|
|
],
|
|
|
|
cmd = " && ".join([
|
|
|
|
"mkdir -p $(@D)",
|
|
|
|
"cp $(@D)/" + b.replace("-", "_") + "_rollup.umd.js $(@D)/" + b + ".dev.test.js",
|
|
|
|
]),
|
|
|
|
)
|
|
|
|
for b in ES2015_BUNDLES
|
|
|
|
]
|
|
|
|
|
|
|
|
# Extract and rename each es5 bundle to a .js and .min.js in the dist/ dir
|
|
|
|
[
|
|
|
|
genrule(
|
|
|
|
name = b[0] + "-dist-test",
|
|
|
|
srcs = [
|
2019-10-27 19:28:03 -04:00
|
|
|
b[0].replace("-", "_") + "_rollup.min.es5umd.js",
|
2019-05-31 11:56:07 -04:00
|
|
|
],
|
|
|
|
outs = [
|
|
|
|
b[0] + ".test.min.js",
|
|
|
|
],
|
|
|
|
cmd = " && ".join([
|
|
|
|
"mkdir -p $(@D)",
|
|
|
|
"cp $(@D)/" + b[0].replace("-", "_") + "_rollup.min.es5umd.js $(@D)/" + b[0] + ".test.min.js",
|
|
|
|
]),
|
|
|
|
)
|
|
|
|
for b in ES5_BUNDLES.items() + ES5_GLOBAL_BUNDLES.items()
|
|
|
|
]
|
|
|
|
|
|
|
|
# Extract and rename each es2015 bundle to a .js and .min.js in the dist/ dir
|
|
|
|
[
|
|
|
|
genrule(
|
|
|
|
name = b + "-dist",
|
|
|
|
srcs = [
|
2019-10-27 19:28:03 -04:00
|
|
|
b.replace("-", "_") + "_rollup.umd.js",
|
|
|
|
b.replace("-", "_") + "_rollup.min.umd.js",
|
2019-05-31 11:56:07 -04:00
|
|
|
],
|
|
|
|
outs = [
|
|
|
|
b + ".js",
|
|
|
|
b + ".min.js",
|
|
|
|
],
|
|
|
|
cmd = " && ".join([
|
|
|
|
"mkdir -p $(@D)",
|
2019-07-29 19:07:43 -04:00
|
|
|
# remove the last line '//# sourceMappingURL=b[0].umd.js.map' because we don't release
|
|
|
|
# source map for now
|
2019-07-29 09:01:13 -04:00
|
|
|
"sed '$$d' $(@D)/" + b.replace("-", "_") + "_rollup.umd.js > $(@D)/" + b + ".js",
|
2019-05-31 11:56:07 -04:00
|
|
|
"cp $(@D)/" + b.replace("-", "_") + "_rollup.min.umd.js $(@D)/" + b + ".min.js",
|
|
|
|
]),
|
|
|
|
)
|
|
|
|
for b in ES2015_BUNDLES
|
|
|
|
]
|
|
|
|
|
|
|
|
# Extract and rename each es5 bundle to a .js and .min.js in the dist/ dir
|
|
|
|
[
|
|
|
|
genrule(
|
|
|
|
name = b + "-dist-test",
|
|
|
|
srcs = [
|
2019-10-27 19:28:03 -04:00
|
|
|
b.replace("-", "_") + "_rollup.min.umd.js",
|
2019-05-31 11:56:07 -04:00
|
|
|
],
|
|
|
|
outs = [
|
|
|
|
b + ".test.min.js",
|
|
|
|
],
|
|
|
|
cmd = " && ".join([
|
|
|
|
"mkdir -p $(@D)",
|
|
|
|
"cp $(@D)/" + b.replace("-", "_") + "_rollup.min.umd.js $(@D)/" + b + ".test.min.js",
|
|
|
|
]),
|
|
|
|
)
|
|
|
|
for b in ES2015_BUNDLES
|
|
|
|
]
|