diff --git a/common/predictive-text/build-bundler.js b/common/predictive-text/build-bundler.js deleted file mode 100644 index 12eac857a5..0000000000 --- a/common/predictive-text/build-bundler.js +++ /dev/null @@ -1,10 +0,0 @@ -import esbuild from 'esbuild'; -import { esmConfiguration } from '../web/es-bundling/build/index.mjs'; - -await esbuild.build({ - ...esmConfiguration, - entryPoints: { - 'index': 'build/obj/web/index.js', - }, - outdir: 'build/lib/web' // We want to preserve the subdirectory for this one. -}); \ No newline at end of file diff --git a/common/predictive-text/build.sh b/common/predictive-text/build.sh index cd304c0b34..7b1a358186 100755 --- a/common/predictive-text/build.sh +++ b/common/predictive-text/build.sh @@ -20,6 +20,8 @@ THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" # This script runs from its own folder cd "$(dirname "$THIS_SCRIPT")" +BUNDLE_CMD="node $KEYMAN_ROOT/common/web/es-bundling/build/common-bundle.mjs" + ################################ Main script ################################ # "@../models/types" \ # is just a .d.ts, so there's nothing to actually BUILD. @@ -45,7 +47,9 @@ function do_build() { tsc -b ./tsconfig.all.json # esbuild-bundled products at this level are not intended to be used for anything but testing. - node build-bundler.js + $BUNDLE_CMD "${KEYMAN_ROOT}/common/predictive-text/build/obj/web/index.js" \ + --out "${KEYMAN_ROOT}/common/predictive-text/build/lib/web/index.mjs" \ + --format esm } # Note - the actual test setup is done in a separate test script, but it's easy diff --git a/common/web/gesture-recognizer/build-bundler.js b/common/web/gesture-recognizer/build-bundler.js deleted file mode 100644 index 5ffe8299e2..0000000000 --- a/common/web/gesture-recognizer/build-bundler.js +++ /dev/null @@ -1,7 +0,0 @@ -import esbuild from 'esbuild'; -import { esmConfiguration, bundleObjEntryPoints, prepareTslibTreeshaking } from '../es-bundling/build/index.mjs'; - -await esbuild.build(await prepareTslibTreeshaking({ - ...esmConfiguration, - ...bundleObjEntryPoints('lib', 'build/obj/index.js') -})); diff --git a/common/web/gesture-recognizer/build.sh b/common/web/gesture-recognizer/build.sh index cd13832323..32f8a4d6db 100755 --- a/common/web/gesture-recognizer/build.sh +++ b/common/web/gesture-recognizer/build.sh @@ -11,6 +11,8 @@ THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BA # This script runs from its own folder cd "$(dirname "$THIS_SCRIPT")" +BUNDLE_CMD="node $KEYMAN_ROOT/common/web/es-bundling/build/common-bundle.mjs" + ################################ Main script ################################ builder_describe "Builds the gesture-recognition model for Web-based on-screen keyboards" \ @@ -47,7 +49,11 @@ fi if builder_start_action build:module; then # Build tsc --build $builder_verbose - node build-bundler.js + + $BUNDLE_CMD "${KEYMAN_ROOT}/common/web/gesture-recognizer/build/obj/index.js" \ + --out "${KEYMAN_ROOT}/common/web/gesture-recognizer/build/lib/index.mjs" \ + --format esm + builder_finish_action success build:module fi diff --git a/common/web/input-processor/build-bundler.js b/common/web/input-processor/build-bundler.js deleted file mode 100644 index 11277c4620..0000000000 --- a/common/web/input-processor/build-bundler.js +++ /dev/null @@ -1,8 +0,0 @@ -import esbuild from 'esbuild'; -import { esmConfiguration, bundleObjEntryPoints } from '../es-bundling/build/index.mjs'; - -// Bundled ES module version -await esbuild.build({ - ...esmConfiguration, - ...bundleObjEntryPoints('lib', 'build/obj/index.js') -}); \ No newline at end of file diff --git a/common/web/input-processor/build.sh b/common/web/input-processor/build.sh index f1d62d12fe..e5fc7a9f72 100755 --- a/common/web/input-processor/build.sh +++ b/common/web/input-processor/build.sh @@ -15,6 +15,8 @@ THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" # This script runs from its own folder cd "$THIS_SCRIPT_PATH" +BUNDLE_CMD="node $KEYMAN_ROOT/common/web/es-bundling/build/common-bundle.mjs" + ################################ Main script ################################ builder_describe "Builds the standalone, headless form of Keyman Engine for Web's input-processor module" \ @@ -36,7 +38,10 @@ builder_parse "$@" function do_build() { tsc -b ./tsconfig.json - node build-bundler.js + + $BUNDLE_CMD "${KEYMAN_ROOT}/common/web/input-processor/build/obj/index.js" \ + --out "${KEYMAN_ROOT}/common/web/input-processor/build/lib/index.mjs" \ + --format esm # Declaration bundling. tsc --emitDeclarationOnly --outFile ./build/lib/index.d.ts diff --git a/common/web/utils/build-bundler.js b/common/web/utils/build-bundler.js deleted file mode 100644 index 11277c4620..0000000000 --- a/common/web/utils/build-bundler.js +++ /dev/null @@ -1,8 +0,0 @@ -import esbuild from 'esbuild'; -import { esmConfiguration, bundleObjEntryPoints } from '../es-bundling/build/index.mjs'; - -// Bundled ES module version -await esbuild.build({ - ...esmConfiguration, - ...bundleObjEntryPoints('lib', 'build/obj/index.js') -}); \ No newline at end of file diff --git a/common/web/utils/build.sh b/common/web/utils/build.sh index 9e4c63d7fa..6523a81a2a 100755 --- a/common/web/utils/build.sh +++ b/common/web/utils/build.sh @@ -14,6 +14,8 @@ THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" cd "$THIS_SCRIPT_PATH" +BUNDLE_CMD="node $KEYMAN_ROOT/common/web/es-bundling/build/common-bundle.mjs" + ################################ Main script ################################ builder_describe \ @@ -38,7 +40,9 @@ function do_build() { # One of the functions (timedPromise) is quite helpful for automated testing, even in the DOM. # So, to make sure it's easily-accessible for the DOM-based tests... - node build-bundler.js + $BUNDLE_CMD "${KEYMAN_ROOT}/common/web/utils/build/obj/index.js" \ + --out "${KEYMAN_ROOT}/common/web/utils/build/lib/index.mjs" \ + --format esm } function do_test() {