Skip to content

Commit

Permalink
core: target ES2022
Browse files Browse the repository at this point in the history
  • Loading branch information
saghul committed Dec 6, 2023
1 parent 5dbe995 commit 1b8c985
Show file tree
Hide file tree
Showing 3 changed files with 28,283 additions and 28,359 deletions.
27 changes: 8 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ JOBS?=$(shell getconf _NPROCESSORS_ONLN)
TJS=$(BUILD_DIR)/tjs
QJSC=$(BUILD_DIR)/tjsc
STDLIB_MODULES=$(wildcard src/js/stdlib/*.js)
ESBUILD_PARAMS_COMMON=--target=es2022 --platform=neutral --format=esm --main-fields=main,module

all: $(TJS)

Expand All @@ -21,11 +22,8 @@ src/bundles/js/core/polyfills.js: src/js/polyfills/*.js
npx esbuild src/js/polyfills/index.js \
--bundle \
--outfile=$@ \
--target=es2020 \
--platform=neutral \
--format=esm \
--main-fields=main,module \
--minify
--minify \
$(ESBUILD_PARAMS_COMMON)

src/bundles/c/core/polyfills.c: $(QJSC) src/bundles/js/core/polyfills.js
@mkdir -p $(basename $(dir $@))
Expand All @@ -39,12 +37,9 @@ src/bundles/js/core/core.js: src/js/core/*.js
npx esbuild src/js/core/index.js \
--bundle \
--outfile=$@ \
--target=es2020 \
--platform=neutral \
--format=esm \
--main-fields=main,module \
--minify \
--external:tjs:*
--external:tjs:* \
$(ESBUILD_PARAMS_COMMON)

src/bundles/c/core/core.c: $(QJSC) src/bundles/js/core/core.js
@mkdir -p $(basename $(dir $@))
Expand All @@ -58,12 +53,9 @@ src/bundles/js/core/run-main.js: src/js/run-main/*.js
npx esbuild src/js/run-main/index.js \
--bundle \
--outfile=$@ \
--target=es2020 \
--platform=neutral \
--format=esm \
--main-fields=main,module \
--minify \
--external:tjs:*
--external:tjs:* \
$(ESBUILD_PARAMS_COMMON)

src/bundles/c/core/run-main.c: $(QJSC) src/bundles/js/core/run-main.js
@mkdir -p $(basename $(dir $@))
Expand All @@ -87,10 +79,7 @@ src/bundles/js/stdlib/%.js: src/js/stdlib/*.js src/js/stdlib/ffi/*.js
npx esbuild src/js/stdlib/$(notdir $@) \
--bundle \
--outfile=$@ \
--target=es2020 \
--platform=neutral \
--format=esm \
--main-fields=main,module
$(ESBUILD_PARAMS_COMMON)

src/bundles/c/stdlib/%.c: $(QJSC) src/bundles/js/stdlib/%.js
@mkdir -p $(basename $(dir $@))
Expand Down
Loading

0 comments on commit 1b8c985

Please sign in to comment.