JoostK 7dcf2864a3 feat(compiler-cli): expose function to allow short-circuiting of linking (#40137)
The linker is implemented using a Babel transform such that Babel needs
to parse and walk a source file to find the declarations that need to be
compiled. If it can be determined that a source file is known not to
contain any declarations the parsing and walking can be skipped as a
performance improvement. This commit adds an exposed function for tools
that integrate the linker to use to allow short-circuiting of the linker
transform.

PR Close #40137
2020-12-22 14:53:02 -08:00

40 lines
1.0 KiB
Python

load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
ts_library(
name = "prelink_bootstrap",
testonly = True,
srcs = ["bootstrap.ts"],
deps = [
"//packages:types",
"//packages/compiler-cli/linker",
"//packages/compiler-cli/linker/babel",
"//packages/compiler-cli/test/compliance_old/mock_compile",
"@npm//@babel/core",
"@npm//@babel/generator",
"@npm//@babel/template",
"@npm//@babel/types",
"@npm//@types/babel__core",
"@npm//@types/babel__generator",
"@npm//@types/babel__template",
"@npm//typescript",
],
)
jasmine_node_test(
name = "prelink",
bootstrap = [
"//tools/testing:node_no_angular_es5",
":prelink_bootstrap_es5",
],
data = [
"//packages/compiler-cli/src/ngtsc/testing/fake_core:npm_package",
],
shard_count = 4,
tags = [
"ivy-only",
],
deps = [
"//packages/compiler-cli/test/compliance_old:test_lib",
],
)