onnxruntime/js/web/lib
Yulong Wang b8917ad84f
[js/web] fix nodejs detection (#16400)
### Description
We used to use `typeof fetch === 'undefined'` as condition to detect the
environment is Node.js or not. Before Node.js v18, this works. However,
in Node.js v18, it introduced `fetch` function, so this check does not
work any more.

This PR changes the condition to check whether `process`,
`process.versions` and `process.versions.node` exists.

Checking whether `process` exists is not enough. This is because in some
configuration, webpack may polyfill nodejs's process.
2023-06-20 00:20:58 -07:00
..
onnxjs [js/web] fix nodejs detection (#16400) 2023-06-20 00:20:58 -07:00
wasm [js/web] fix nodejs detection (#16400) 2023-06-20 00:20:58 -07:00
backend-onnxjs.ts
backend-wasm.ts [js/webgpu] support proxy for webgpu (#15851) 2023-05-15 16:23:13 -07:00
build-def.d.ts [js/web] WebGPU backend via JSEP (#14579) 2023-04-24 15:21:18 -07:00
index.ts [js] add API that allows to get package version (#16207) 2023-06-09 16:18:53 -07:00
version.ts [js] add API that allows to get package version (#16207) 2023-06-09 16:18:53 -07:00