mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-16 21:00:14 +00:00
* es2017 by default for ort-common * add visualizer and define plugin * es2017 for ort-web. also add build target for es5 * add multiple reduced size build for ort-web * resolve comments, add e2e tests and add docs
19 lines
877 B
TypeScript
19 lines
877 B
TypeScript
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// Licensed under the MIT License.
|
|
|
|
/* eslint-disable @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports */
|
|
// We use "require" instead of "import" here because import statement must be put in top level. Our current code does
|
|
// not allow terser to tree-shaking code as expected because some codes are treated as having side effects.
|
|
// So we import code inside the if-clause to allow terser remove the code safely.
|
|
|
|
export * from 'onnxruntime-common';
|
|
import {registerBackend} from 'onnxruntime-common';
|
|
|
|
if (!BUILD_DEFS.DISABLE_WEBGL) {
|
|
const onnxjsBackend = require('./backend-onnxjs').onnxjsBackend;
|
|
registerBackend('webgl', onnxjsBackend, -1);
|
|
}
|
|
if (!BUILD_DEFS.DISABLE_WASM) {
|
|
const wasmBackend = require('./backend-wasm').wasmBackend;
|
|
registerBackend('wasm', wasmBackend, 0);
|
|
}
|