-
Notifications
You must be signed in to change notification settings - Fork 520
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(examples): show how to use ts_library(use_angular_plugin) with w…
…orker mode (#1839)
- Loading branch information
Showing
10 changed files
with
52 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") | ||
|
||
# Custom ts_library compiler that runs tsc_wrapped with angular/compiler-cli statically linked | ||
# This can be used with worker mode because we don't need the linker at runtime to make | ||
# the angular plugin loadable | ||
# Just a clone of @npm//@bazel/typescript/bin:tsc_wrapped with added deps | ||
nodejs_binary( | ||
name = "tsc_wrapped_with_angular", | ||
data = [ | ||
"@npm//@angular/compiler-cli", | ||
"@npm//@bazel/typescript", | ||
], | ||
entry_point = "@npm//:node_modules/@bazel/typescript/internal/tsc_wrapped/tsc_wrapped.js", | ||
visibility = ["//:__subpackages__"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"Shows how to enable both worker mode and use_angular_plugin to make a drop-in replacement for ng_module" | ||
|
||
load("@npm_bazel_typescript//:index.bzl", "ts_library") | ||
|
||
def ng_ts_library(**kwargs): | ||
ts_library( | ||
compiler = "//tools:tsc_wrapped_with_angular", | ||
supports_workers = True, | ||
use_angular_plugin = True, | ||
**kwargs | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters