-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create ng_js_binary macro to wrap esbuild for prod
- Loading branch information
1 parent
73ba7cb
commit 8274cd0
Showing
3 changed files
with
23 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
"""Wrapper for building a js binary. | ||
""" | ||
|
||
load("//tools/angular:index.bzl", "LINKER_PROCESSED_FW_PACKAGES") | ||
load("//tools:defaults.bzl", "esbuild") | ||
|
||
def ng_js_binary(name, deps = [], entry_points = []): | ||
esbuild( | ||
name = name, | ||
config = "//web/src/app:esbuild_config", | ||
entry_points = entry_points, | ||
platform = "browser", | ||
splitting = True, | ||
# We cannot use `ES2017` or higher as that would result in `async/await` not being downleveled. | ||
# ZoneJS needs to be able to intercept these as otherwise change detection would not work properly. | ||
target = "es2016", | ||
deps = LINKER_PROCESSED_FW_PACKAGES + deps, | ||
) |
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