Skip to content

Commit 2a90269

Browse files
clydinangular-robot[bot]
authored andcommitted
build: update output target to ES2020
The minimum supported Node.js version is now v16.13. This version provides full support for ES2020 allowing the output code target to be increased. While Node.js v16.13 supports higher ECMAScript versions, a limitation of the bazel `ts_library` rule currently prevents increasing further at this time.
1 parent 2aee441 commit 2a90269

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

WORKSPACE

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ nodejs_register_toolchains(
6161
node_version = "18.10.0",
6262
)
6363

64+
# Set the default nodejs toolchain to the latest supported major version
65+
nodejs_register_toolchains(
66+
name = "nodejs",
67+
node_version = "18.10.0",
68+
)
69+
6470
load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install")
6571

6672
yarn_install(

tools/defaults.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def ts_library(
3636
if not devmode_module:
3737
devmode_module = "commonjs"
3838
if not devmode_target:
39-
devmode_target = "es2018"
39+
devmode_target = "es2020"
4040

4141
_ts_library(
4242
name = name,
@@ -46,6 +46,7 @@ def ts_library(
4646
tsconfig = tsconfig,
4747
devmode_module = devmode_module,
4848
devmode_target = devmode_target,
49+
prodmode_target = "es2020",
4950
# @external_end
5051
**kwargs
5152
)

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"outDir": "./dist",
1212
"skipLibCheck": true,
1313
"strict": true,
14-
"target": "es2019",
14+
"target": "es2020",
1515
"lib": ["es2020"],
1616
"rootDir": ".",
1717
"rootDirs": [".", "./dist-schema/bin/"],

0 commit comments

Comments
 (0)