Skip to content

Commit 04423f1

Browse files
committed
Trim library footprint and target ES2020
1 parent 3b45f4d commit 04423f1

4 files changed

Lines changed: 5 additions & 13 deletions

File tree

Herebyfile.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ function createBundler(entrypoint, outfile, taskOptions = {}) {
172172
bundle: true,
173173
outfile,
174174
platform: "node",
175-
target: "es2018",
175+
target: "es2020",
176176
format: "cjs",
177177
sourcemap: "linked",
178178
sourcesContent: false,
@@ -187,8 +187,6 @@ function createBundler(entrypoint, outfile, taskOptions = {}) {
187187
options.format = "iife";
188188
// Name the variable ts, matching our old big bundle and so we can use the code below.
189189
options.globalName = "ts";
190-
// If we are in a CJS context, export the ts namespace.
191-
options.footer = { js: `\nif (typeof module !== "undefined" && module.exports) { module.exports = ts; }` };
192190

193191
// esbuild converts calls to "require" to "__require"; this function
194192
// calls the real require if it exists, or throws if it does not (rather than

src/tsconfig-base.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"outDir": "../built/local",
55

66
"pretty": true,
7-
"lib": ["es2018"],
8-
"target": "es2018",
7+
"lib": ["es2020"],
8+
"target": "es2020",
99
"module": "CommonJS",
1010
"moduleResolution": "node",
1111

src/typescript/_namespaces/ts.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
/* Generated file to emulate the ts namespace. */
22

33
export * from "../../compiler/_namespaces/ts";
4-
export * from "../../jsTyping/_namespaces/ts";
5-
export * from "../../services/_namespaces/ts";
6-
export * from "../../deprecatedCompat/_namespaces/ts";

src/typescript/typescript.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
import {
2-
Debug,
3-
LogLevel,
4-
} from "./_namespaces/ts";
51
import * as ts from "./_namespaces/ts";
62

73
// enable deprecation logging
84
declare const console: any;
95
if (typeof console !== "undefined") {
10-
Debug.loggingHost = {
6+
const { LogLevel } = ts;
7+
ts.Debug.loggingHost = {
118
log(level, s) {
129
switch (level) {
1310
case LogLevel.Error: return console.error(s);

0 commit comments

Comments
 (0)