test(ivy): also track the size of the compressed hello world bundle (#22056)
PR Close #22056
This commit is contained in:
parent
83d43ac850
commit
16e5b866d2
@ -69,6 +69,9 @@ jobs:
|
|||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: dist/bin/packages/core/test/bundling/hello_world/bundle.min.js
|
path: dist/bin/packages/core/test/bundling/hello_world/bundle.min.js
|
||||||
destination: packages/core/test/bundling/hello_world/bundle.min.js
|
destination: packages/core/test/bundling/hello_world/bundle.min.js
|
||||||
|
- store_artifacts:
|
||||||
|
path: dist/bin/packages/core/test/bundling/hello_world/bundle.min.js.brotli
|
||||||
|
destination: packages/core/test/bundling/hello_world/bundle.min.js.brotli
|
||||||
|
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: *cache_key
|
key: *cache_key
|
||||||
|
@ -68,3 +68,10 @@ git_repository(
|
|||||||
remote = "https://github.com/angular/devkit.git",
|
remote = "https://github.com/angular/devkit.git",
|
||||||
commit = "69fcdee61c5ff3f08aa609dec69155dfd29c809a",
|
commit = "69fcdee61c5ff3f08aa609dec69155dfd29c809a",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
http_archive(
|
||||||
|
name = "org_brotli",
|
||||||
|
url = "https://github.com/google/brotli/archive/v1.0.2.zip",
|
||||||
|
strip_prefix = "brotli-1.0.2",
|
||||||
|
sha256 = "b43d5d6bc40f2fa6c785b738d86c6bbe022732fe25196ebbe43b9653a025920d",
|
||||||
|
)
|
||||||
|
@ -26,6 +26,14 @@ PLUGIN_CONFIG="{sideEffectFreeModules: [\n%s]}" % ",\n".join(
|
|||||||
BO_ROLLUP="angular_devkit/packages/angular_devkit/build_optimizer/src/build-optimizer/rollup-plugin.js"
|
BO_ROLLUP="angular_devkit/packages/angular_devkit/build_optimizer/src/build-optimizer/rollup-plugin.js"
|
||||||
BO_PLUGIN="require('%s').default(%s)" % (BO_ROLLUP, PLUGIN_CONFIG)
|
BO_PLUGIN="require('%s').default(%s)" % (BO_ROLLUP, PLUGIN_CONFIG)
|
||||||
|
|
||||||
|
def run_brotli(ctx, input, output):
|
||||||
|
ctx.action(
|
||||||
|
executable = ctx.executable._brotli,
|
||||||
|
inputs = [input],
|
||||||
|
outputs = [output],
|
||||||
|
arguments = ["--output=%s" % output.path, input.path],
|
||||||
|
)
|
||||||
|
|
||||||
def _ng_rollup_bundle(ctx):
|
def _ng_rollup_bundle(ctx):
|
||||||
# We don't expect anyone to make use of this bundle yet, but it makes this rule
|
# We don't expect anyone to make use of this bundle yet, but it makes this rule
|
||||||
# compatible with rollup_bundle which allows them to be easily swapped back and
|
# compatible with rollup_bundle which allows them to be easily swapped back and
|
||||||
@ -52,6 +60,8 @@ def _ng_rollup_bundle(ctx):
|
|||||||
run_uglify(ctx, ctx.outputs.build_es5, ctx.outputs.build_es5_min)
|
run_uglify(ctx, ctx.outputs.build_es5, ctx.outputs.build_es5_min)
|
||||||
run_uglify(ctx, ctx.outputs.build_es5, ctx.outputs.build_es5_min_debug, debug = True)
|
run_uglify(ctx, ctx.outputs.build_es5, ctx.outputs.build_es5_min_debug, debug = True)
|
||||||
|
|
||||||
|
run_brotli(ctx, ctx.outputs.build_es5_min, ctx.outputs.build_es5_min_compressed)
|
||||||
|
|
||||||
return DefaultInfo(files=depset([ctx.outputs.build_es5_min]))
|
return DefaultInfo(files=depset([ctx.outputs.build_es5_min]))
|
||||||
|
|
||||||
ng_rollup_bundle = rule(
|
ng_rollup_bundle = rule(
|
||||||
@ -63,8 +73,14 @@ ng_rollup_bundle = rule(
|
|||||||
]),
|
]),
|
||||||
"_rollup": attr.label(
|
"_rollup": attr.label(
|
||||||
executable = True,
|
executable = True,
|
||||||
cfg="host",
|
cfg = "host",
|
||||||
default = Label("@angular//packages/bazel/src:rollup_with_build_optimizer")),
|
default = Label("@angular//packages/bazel/src:rollup_with_build_optimizer")),
|
||||||
|
"_brotli": attr.label(
|
||||||
|
executable = True,
|
||||||
|
cfg = "host",
|
||||||
|
default = Label("@org_brotli//:brotli")),
|
||||||
}),
|
}),
|
||||||
outputs = ROLLUP_OUTPUTS,
|
outputs = dict(ROLLUP_OUTPUTS, **{
|
||||||
)
|
"build_es5_min_compressed": "%{name}.min.js.brotli",
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
@ -39,6 +39,7 @@ jasmine_node_test(
|
|||||||
data = [
|
data = [
|
||||||
":bundle",
|
":bundle",
|
||||||
":bundle.js",
|
":bundle.js",
|
||||||
|
":bundle.min.js.brotli",
|
||||||
":bundle.min_debug.js",
|
":bundle.min_debug.js",
|
||||||
],
|
],
|
||||||
deps = [":test_lib"],
|
deps = [":test_lib"],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user