From 99f4f830bb266df2016c1046731a837b8b9dc898 Mon Sep 17 00:00:00 2001 From: ShareVB Date: Tue, 13 May 2025 16:38:49 +0200 Subject: [PATCH] chore: optimize onnxruntime-node --- vite.config.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index 46bb0b92..d92ee5e7 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -115,6 +115,7 @@ export default defineConfig({ 'fs': fileURLToPath(new URL('./src/_empty.ts', import.meta.url)), '@babel/core': fileURLToPath(new URL('./src/_empty.ts', import.meta.url)), 'isolated-vm': fileURLToPath(new URL('./src/_empty.ts', import.meta.url)), + 'onnxruntime-node': fileURLToPath(new URL('./src/_empty.ts', import.meta.url)), }, }, define: { @@ -131,7 +132,7 @@ export default defineConfig({ // cssMinify: false, modulePreload: false, rollupOptions: { - external: ['regex', './out/isolated_vm', 'isolated-vm'], + external: ['regex', './out/isolated_vm', 'isolated-vm', 'onnxruntime-node'], output: { format: 'es', manualChunks: (id) => { @@ -153,7 +154,7 @@ export default defineConfig({ }, }, optimizeDeps: { - include: ['isolated-vm', 'pdfjs-dist'], // optionally specify dependency name + include: ['isolated-vm', 'pdfjs-dist', 'onnxruntime-node'], // optionally specify dependency name esbuildOptions: { supported: { 'top-level-await': true,