Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion js/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,15 @@
"default": "./dist/ort.jspi.bundle.min.mjs"
},
"require": "./dist/ort.jspi.min.js"
}
},
"./ort-wasm-simd-threaded.wasm": "./dist/ort-wasm-simd-threaded.wasm",
"./ort-wasm-simd-threaded.jsep.wasm": "./dist/ort-wasm-simd-threaded.jsep.wasm",
"./ort-wasm-simd-threaded.jspi.wasm": "./dist/ort-wasm-simd-threaded.jspi.wasm",
"./ort-wasm-simd-threaded.asyncify.wasm": "./dist/ort-wasm-simd-threaded.asyncify.wasm",
"./ort-wasm-simd-threaded.mjs": "./dist/ort-wasm-simd-threaded.mjs",
"./ort-wasm-simd-threaded.jsep.mjs": "./dist/ort-wasm-simd-threaded.jsep.mjs",
"./ort-wasm-simd-threaded.jspi.mjs": "./dist/ort-wasm-simd-threaded.jspi.mjs",
"./ort-wasm-simd-threaded.asyncify.mjs": "./dist/ort-wasm-simd-threaded.asyncify.mjs"
},
"types": "./types.d.ts",
"description": "A Javascript library for running ONNX models on browsers"
Expand Down
6 changes: 5 additions & 1 deletion js/web/test/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"rollup": "^4.13.2",
"rollup-plugin-copy": "^3.5.0",
"tree-kill": "^1.2.2",
"vite": "^7.1.12",
"webpack-cli": "^5.1.4"
},
"scripts": {
Expand All @@ -32,7 +33,10 @@
"build:p:esmjs": "parcel build --no-autoinstall --target esm && node ./bundler.esm.postprocess.js ./dist/parcel_esm_js/main.js",
"build:p:umdjs": "parcel build --no-autoinstall --target umd",
"build:p": "npm run build:p:esmjs && npm run build:p:umdjs",
"build": "npm run build:w && npm run build:r && npm run build:p"
"build:v:esmjs": "vite build -c vite.config.esm-js.js",
"build:v:umdjs": "vite build -c vite.config.umd-js.js",
"build:v": "npm run build:v:esmjs && npm run build:v:umdjs",
"build": "npm run build:v && npm run build:w && npm run build:r && npm run build:p"
},
"@parcel/resolver-default": {
"packageExports": true
Expand Down
2 changes: 2 additions & 0 deletions js/web/test/e2e/run-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ const BUNDLER_TEST_CASES = [
['./dist/rollup_umd_js/ort-test-e2e.bundle.js', 'iife'],
['./dist/parcel_esm_js/main.js', 'esm'],
['./dist/parcel_umd_js/main.js', 'iife'],
['./dist/vite_esm_js/ort-test-e2e.bundle.mjs', 'esm'],
['./dist/vite_umd_js/ort-test-e2e.bundle.js', 'iife'],
];

module.exports = {
Expand Down
13 changes: 13 additions & 0 deletions js/web/test/e2e/src/cjs-js/vite-main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require('onnxruntime-web/ort-wasm-simd-threaded.wasm?url&no-inline');
require('onnxruntime-web/ort-wasm-simd-threaded.mjs?url&no-inline');

require('onnxruntime-web/ort-wasm-simd-threaded.jsep.wasm?url&no-inline');
require('onnxruntime-web/ort-wasm-simd-threaded.jsep.mjs?url&no-inline');

require('onnxruntime-web/ort-wasm-simd-threaded.jspi.wasm?url&no-inline');
require('onnxruntime-web/ort-wasm-simd-threaded.jspi.mjs?url&no-inline');

require('onnxruntime-web/ort-wasm-simd-threaded.asyncify.wasm?url&no-inline');
require('onnxruntime-web/ort-wasm-simd-threaded.asyncify.mjs?url&no-inline');

require('./main');
13 changes: 13 additions & 0 deletions js/web/test/e2e/src/esm-js/vite-main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import 'onnxruntime-web/ort-wasm-simd-threaded.wasm?url&no-inline';
import 'onnxruntime-web/ort-wasm-simd-threaded.mjs?url&no-inline';

import 'onnxruntime-web/ort-wasm-simd-threaded.jsep.wasm?url&no-inline';
import 'onnxruntime-web/ort-wasm-simd-threaded.jsep.mjs?url&no-inline';

import 'onnxruntime-web/ort-wasm-simd-threaded.jspi.wasm?url&no-inline';
import 'onnxruntime-web/ort-wasm-simd-threaded.jspi.mjs?url&no-inline';

import 'onnxruntime-web/ort-wasm-simd-threaded.asyncify.wasm?url&no-inline';
import 'onnxruntime-web/ort-wasm-simd-threaded.asyncify.mjs?url&no-inline';

import './main.js';
22 changes: 22 additions & 0 deletions js/web/test/e2e/vite.config.esm-js.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

const path = require('node:path');
const { defineConfig } = require('vite');

module.exports = defineConfig({
build: {
outDir: path.resolve(__dirname, 'dist/vite_esm_js'),
emptyOutDir: true,
sourcemap: false,
lib: {
name: 'testPackageConsuming',
entry: path.resolve(__dirname, 'src/esm-js/vite-main.js'),
fileName: () => 'ort-test-e2e.bundle.mjs',
formats: ['es'],
},
minify: false,
assetsDir: './',
assetsInlineLimit: 0,
},
});
28 changes: 28 additions & 0 deletions js/web/test/e2e/vite.config.umd-js.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

const path = require('node:path');
const { defineConfig } = require('vite');

module.exports = defineConfig({
build: {
outDir: path.resolve(__dirname, 'dist/vite_umd_js'),
emptyOutDir: true,
sourcemap: false,
lib: {
name: 'testPackageConsuming',
entry: path.resolve(__dirname, 'src/esm-js/vite-main.js'),
fileName: () => 'ort-test-e2e.bundle.js',
formats: ['umd'],
},
minify: false,
assetsDir: './',
assetsInlineLimit: 0,
commonjsOptions: {
include: ['**/*.js'],
exclude: [],
transformMixedEsModules: true,
ignoreDynamicRequires: true,
},
},
});
Loading