Priority: LOW
Problem
The custom serveOnnxFiles() Vite plugin manually parses URLs to serve ONNX WASM files. This is fragile and could break if the path structure of the onnxruntime-web package changes in future versions.
Current Implementation
// vite.config.js - serveOnnxFiles() plugin
// Manually intercepts requests and serves .wasm files from node_modules
Suggested Fix
Investigate using standard Vite WASM plugins:
vite-plugin-wasm
@aspect-build/rules_wasm
- Or a simpler approach: copy WASM files to
public/ at build time
// Option: Copy plugin
{
name: 'copy-onnx-wasm',
buildStart() {
// Copy ort-wasm*.wasm files to public/
}
}
Considerations
- Must maintain compatibility with
vad-web (CJS module, see CLAUDE.md)
talkinghead uses dynamic workers and MUST stay excluded from optimizeDeps
- After any changes: delete
node_modules/.vite cache and test thoroughly
Files Affected
Priority: LOW
Problem
The custom
serveOnnxFiles()Vite plugin manually parses URLs to serve ONNX WASM files. This is fragile and could break if the path structure of theonnxruntime-webpackage changes in future versions.Current Implementation
Suggested Fix
Investigate using standard Vite WASM plugins:
vite-plugin-wasm@aspect-build/rules_wasmpublic/at build timeConsiderations
vad-web(CJS module, see CLAUDE.md)talkingheaduses dynamic workers and MUST stay excluded from optimizeDepsnode_modules/.vitecache and test thoroughlyFiles Affected
frontend/vite.config.js