From dd805ff77d896e9ff5457818c49d2103d6ba6248 Mon Sep 17 00:00:00 2001 From: Yulong Wang <7679871+fs-eire@users.noreply.github.com> Date: Tue, 11 Jun 2024 11:14:55 -0700 Subject: [PATCH] [js/web] ESM: use the bundled target as default export (#20991) ### Description ESM: use the bundled target as default export In this change, the default import of the following entries: ``` import from 'onnxruntime-web'; import from 'onnxruntime-web/all'; import from 'onnxruntime-web/webgpu'; ``` will use the "bundled" version, which has no dynamic import. This change should only apply to ESM on web. --- js/web/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/web/package.json b/js/web/package.json index f1032e956a24b..261251eda77c5 100644 --- a/js/web/package.json +++ b/js/web/package.json @@ -73,13 +73,13 @@ "import": "./dist/ort.node.min.mjs", "require": "./dist/ort.node.min.js" }, - "import": "./dist/ort.min.mjs", + "import": "./dist/ort.bundle.min.mjs", "require": "./dist/ort.min.js", "types": "./types.d.ts" }, "./all": { "node": null, - "import": "./dist/ort.all.min.mjs", + "import": "./dist/ort.all.bundle.min.mjs", "require": "./dist/ort.all.min.js", "types": "./types.d.ts" }, @@ -97,7 +97,7 @@ }, "./webgpu": { "node": null, - "import": "./dist/ort.webgpu.min.mjs", + "import": "./dist/ort.webgpu.bundle.min.mjs", "require": "./dist/ort.webgpu.min.js", "types": "./types.d.ts" },