mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-19 21:32:23 +00:00
### Description
Use esbuild to accelerate bundle build.
This change uses esbuild to replace webpack for onnxruntime-web. Bundle
build time reduced from ~20sec to ~0.6sec on my windows dev box.
A few changes applied:
- import nodejs modules using "node:" prefix
- remove enum declaration inside namespace (EncoderUsage)
- use "fs/promise" to replace the old promisify from "util"
- separate ort-web and test-runner. Previously they are bundled
together, now they are built into 2 files.
- optimize karma runner launch time
- remove unnecessary sourcemap preprocessor. sourcemaps are handled
inside esbuild
- remove unnecessary proxies (because ort-web and test-runner are
separated now, the path are correctly inferred)
- remove file watcher for test data
- optimize special handling as esbuild plugins:
- polyfill dummy imports for node.js modules when targetting browser.
- load as content string for ort-wasm-*.worker.js
- load as content string for ./proxy-worker/main.ts
- a source patch to ort-wasm*-threaded*.js (see details in comments in
code)
- updated debug configurations for sourcemap mapping to ensure
out-of-box good dev experience
46 lines
1.9 KiB
JSON
46 lines
1.9 KiB
JSON
{
|
|
"devDependencies": {
|
|
"@types/fs-extra": "^11.0.1",
|
|
"@types/mocha": "^10.0.1",
|
|
"@types/node": "^18.14.6",
|
|
"@types/npmlog": "^4.1.4",
|
|
"@typescript-eslint/eslint-plugin": "^5.54.1",
|
|
"@typescript-eslint/parser": "^5.54.1",
|
|
"clang-format": "^1.8.0",
|
|
"dir-compare": "^4.0.0",
|
|
"esbuild": "^0.19.3",
|
|
"esbuild-plugin-polyfill-node": "^0.3.0",
|
|
"eslint": "^8.35.0",
|
|
"eslint-plugin-header": "^3.1.1",
|
|
"eslint-plugin-import": "^2.27.5",
|
|
"eslint-plugin-jsdoc": "^40.0.1",
|
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
"eslint-plugin-unicorn": "^46.0.0",
|
|
"fs-extra": "^11.1.0",
|
|
"jszip": "^3.10.1",
|
|
"mocha": "^10.2.0",
|
|
"node-polyfill-webpack-plugin": "^2.0.1",
|
|
"npmlog": "^7.0.1",
|
|
"prettier": "^3.0.0",
|
|
"terser": "^5.16.5",
|
|
"ts-loader": "^9.4.2",
|
|
"typescript": "^4.9.5",
|
|
"webpack": "^5.76.0",
|
|
"webpack-bundle-analyzer": "^4.8.0",
|
|
"webpack-cli": "^5.0.1",
|
|
"worker-loader": "^3.0.8"
|
|
},
|
|
"scripts": {
|
|
"prepare": "tsc --build scripts",
|
|
"lint": "eslint . --ext .ts --ext .tsx",
|
|
"format:ts": "clang-format --glob=\"{scripts/**/*.ts,common/{lib,test}/**/*.ts,node/{lib,script,test}/**/*.ts,web/{lib,script,test}/**/*.ts,react_native/{android,example,ios,lib}/**/*.{ts,tsx}}\" --style=file -i",
|
|
"format:js": "clang-format --glob=\"{{,common,node,web,react_native}/{*,.*}.{,m,c}js,web/test/e2e/**/*.{,m,c}js}\" --style=file -i",
|
|
"format:cf": "clang-format --glob=\"{node/src/**/*.{cc,h},react_native/{android,example,ios,lib}/**/*.{mm,java}}\" --style=file -i",
|
|
"format:json": "prettier \"**/*.{json,jsonc}\" --write",
|
|
"format:md": "prettier \"**/*.md\" --write",
|
|
"format": "npm run format:ts && npm run format:js && npm run format:cf && npm run format:json && npm run format:md",
|
|
"prepare-node-tests": "node ./scripts/prepare-onnx-node-tests",
|
|
"update-version": "node ./scripts/update-version"
|
|
},
|
|
"license": "MIT"
|
|
}
|